Rename Excel Sheet for MULTIPLE Excel Files

Hello again… how can I accomplish the following?

I have a FOLDER with 40 excel files, all have the same structure and a sheet named “Información”
I want to take the value for cell “B1” inside each excel file and be used to rename the “Información” sheet.

As in the picture… any suggestion?
Thanks!

hey

try this

Regards!

1 Like

Hi,

Hope the following helps you.

Regards,

1 Like

please use the @Yoichi solutions, i provided to rename the file not the sheet name

Regards!

Yes, thanks, also have that doubt! so you already answered.
regards

Thanks! al ready worked as expected!

1 Like

Hi Yoichi… after this, I want to move forward on deleting the fisrt 4 rows, again for each file in the first sheet.
I tried to use your same workflow , after “use excel file” I added the “delete excel row” but I,am lost about how to specify like for each current sheet.

Do you mind to make a suggestion.
Thanks

Hi,

How about like the following?

regards,

Thanks! one question I just tried and get an error “Rename Sheet Value Cannot be null” … since now all the “fisrt” sheets were renamed, so no longer named “Información”, do I need to specify some way that I,am refering to make the deletion on the FIRST SHEET?

Hi,

This error shows sheetname variable is null. So, first, can you check content of B1 cell of the sheet?

Regards,

Hi, thanks!
The situation is that it is working fine with the first file, deleteing the rows, but then for the next excel file, it added a new blank sheet with the name of the previous file, instead of delete the rows on the first sheet of the 2nd file… attached an image for better explain.

Thanks

Hi,

Is your sheet to read from B1 has same name as its filename? If so,the following will work.

infoSheetName = System.IO.Path.GetFileNameWithoutExtension(currentFile.Name)

If not, can you share naming rule of the target sheet?

Regards,

1 Like

Woow, thanks a lot, it works!.
Regards!

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