How to get the list of values from drop down button which is inside Excel sheet

Hey guys,

Need a quick help,

I have a drop down in my excel sheet like this

From this i have to get all the values and select one by one by looping.

Any quick suggestions or approaches or code is also😜 appreciated. I’ll try to upload sample excel sheet ASAP.

1 Like

I believe that the dropdown items are the ones that are present in that particular column of excel. You can fetch all the values of that column and remove duplicates which would then give you the list which is same as dropdown items.


Are these drop downs …from Named range ?

Hi @harsha1123

Use“[Gross Margin]<>‘’”).CopyToDatatable()


DataView view = new DataView(table)
DataTable distinctValues = view.ToTable(true, "Column1", "Column2" ...)
DataTable =DataTable.DefaultView.ToTable(true)

ashwin S

Named Range usage is a good approach
Find children Activity is another Option for this use case


go to “formula” tab in exel. and see if the any Named ranges are there .

if you have Named range eg. “GrossMargin” . you may use following …

From row In Gross_list.Select Select Convert.ToString(row(*GrossMargin"))).ToArray().

Thank you @Vijay_chandran for the prompt reply i have solved this.


1 Like

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