Extarct Column name of the identified value

Hi

Just a quick question. Please help me

image

For the above example I am locating the values 35.19 by comparing two excels.

how can I take the column name of the specific value 35.19? The answer would be 4 .

@kavinnatarajan

Try this:

MyDataTable.Columns(4).ColumnName

Here, 4 is column index.

1 Like

are you using read range activity? if yes, remember to click add header box then it will set the first row to be the column header.

if the number is dynamic what shud we do?

@Jebarohith19

You need to loop all Columns one by one and use one incrementer. If you find required matching then stop iterating loop and fetch value of incrementer.

Im asking is MyDataTable.Columns(4).ColumnName i have to iterate columns number but when i pur counter there and iterate it is not showing columnName function

@Jebarohith19

Try like this.

       ForEach item in DataTable.Columns
               Int counter = 1
            If item.ColumnName = "required column"
            Then 
                   Int index = counter
             Else 
                   counter = counter + 1

Okay ill try that thanks @lakshman

1 Like