Get excel data by column name

I have an excel and want to get the whole column data if it has the same column name that I want. I do not want to get data by its row or column number. How can I do that?

Hello @Emily_Yip
You can use LinQ’s select method

just take an assign activity an assign a this code to a List<of String> data type

DT1.AsEnumerable.Select(function(r) cstr(r("ColumnName"))).tolist

You’ll get the whole column data in a list

@Emily_Yip

Hi buddy,

Use this is assign outDT=inputDT.defaultview.totable(false, “ColumnName”)
You can copy all values from the desired CN to new DT variable.

cheers.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.