Extarct Column name of the identified value


Just a quick question. Please help me


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 .


Try this:


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?


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


Try like this.

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

Okay ill try that thanks @lakshman

1 Like