Get sheet name base con column name

Hi Everyone.

I want to loop all sheets in excel file and got sheet name if that sheet contain 3 columns with name “code” “name” “quantity”. And then Read Range from index which contains these column names

How to do that ?

Thansk you!
Book1.xlsx (9.2 KB)

@Mr.H
Try something like this,

2 Likes

@Mr.H - Here you go…Get Workbook Sheets.xaml (14.1 KB)

Output: image

1 Like

Most basic way, I think there is an activity called Get sheets

Use it to get a list of sheets into a collection

Loop through the sheets and for each sheet,

Read Range by limiting the range to just get the first row into a Datatable.

Obviously, If the first row of the Datatable has names that you require, then you read the data from this sheet.

The jndex of the column will give you the position of each column

Hope this helps.

2 Likes

Hi Bro.

Thanks you but how to check row index ( in Sheet2 is row(1) contain these columns )

If row(1) not contain, it will return false

@Mr.H - Both @sarathi125 and I have provided the solution , which has the answer you are looking for. Did you opened my xaml?

1 Like

Thanks you bro.

I have another question.

After get Sheet Name… how to change it into another name ?

@Mr.H,

If you need to rename the sheet in the workbook, then use UiPathTeam.Excel.Extensions.Activities.

https://feed.uipath.com/packages/UiPathTeam.Excel.Extensions.Activities/1.0.7018.25224

2 Likes

Thanks you bro!

1 Like

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