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
dropdown

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

Hi,
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.

Hi

Are these drop downs …from Named range ?

Hi @harsha1123

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

(or)

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

Thanks
ashwin S

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

Hi

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.

Cheers!

1 Like

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