Search for Sheet Name

I’m trying to use the LookUp function and write a range from an Excel workbook however the sheet name will not always be the same. How can I write a range without knowing the sheet name?

Hi @scott.luntz,

Before write range, u can use https://docs.uipath.com/activities/lang-en/docs/excel-get-workbook-sheets to get sheet names.

sheetNames.xaml (5.2 KB)

Thanks!

Thank you. However this only returns one sheet name where I have multiple sheet names. I’m trying to select a string across all of the sheets. Please help.

sheetNames.xaml (6.2 KB)

Check this…!

It will return all the sheet names in excel file.

Thanks!

Thank you so much! Is there a way I can then select the correct sheet name according to what is displayed?

Hi @scott.luntz

For retrieving multiple sheets names from excel you can use get workbook sheets Activity

Which will retrieve the array of all sheet names

image

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

Thank you. How can I then select the correct sheet name and read from it?

Hi @scott.luntz

So as per the List suppose your output variable is sheetName

So use it as below
sheetName(0).ToString

Like wise by changing the index you will get all the sheet names

Mark as solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer: