Check Sheet Name in Read Range

Hello Everyone,
So we have multiple Sheets which are in this Format “AN” “-” + Org Code
Example
1)AN-WE08
2)AN-YE88

So over here if we concatenate AN and the Org Code have had one issue

At times there could be a possibility that by mistake space was added in sheet name and its in below format
AN- WE08 or AN -WE08

How we can resolve this scenario

Your solutions are appreciated :slightly_smiling_face:

@anmita

You can do get worksheets and then use string.contains to check if the sheetname is equal to what name you need

https://docs.uipath.com/activities/docs/excel-get-workbook-sheets

Cheers

Hi @anmita ,

To get the sheets name , you can use this activity.

To remove the space in the name

myString = myString.Replace(" ", "")

or

myStr = Regex.Replace(myStr, "\s", "")

Regards
Balamurugan.S

Hi,

Hope the following helps you.

sheetname = sheets.Where(Function(s) s.Replace(" ","")=target).FirstOrDefault 

Please note that it might be necessary to check ShowClassic at Filter in Activities panel to use GetWorkbookSheets activity.

image

Regards,

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