Hello,
Can I in some way change the name of three sheets in a closed workbook? I then want to import data from that workbook but that does not work as I have to first rename some of the sheets.
How do I solve this problem?
Hello,
Can I in some way change the name of three sheets in a closed workbook? I then want to import data from that workbook but that does not work as I have to first rename some of the sheets.
How do I solve this problem?
Why do you need to change the worksheet name?
How are you currently importing the data?
let Source = #table({"Question","Thread", "User"},{{"Answered","Mark Solved", "Add Reputation"}}) in Source
If I give you Power Query (Get & Transform Data) code, and you don't know what to do with it, then CLICK HERE
Walking the tightrope between genius and eejit...
The file is coming from a system that names 3 out of 7 namnes with a . in the name example "RET. MAT. AQ" and those names I have changed them manually. the names that are ex "RETURN MATERIAL AQ" works without me renaming the name of the sheet.
Therefore I want to rename some of the sheets without . so that I can import all the data in the same way.
If you open the workbook and run this macro, it will remove all the periods in the sheet names. If you want the macro to open the workbook for you, I would need the workbook name including the extension and the full path to the folder containing it.
![]()
Please Login or Register to view this content.
You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
Practice makes perfect. I'm very far from perfect so I'm still practising.
I want to run the macro from antother workbook. The name of the workbook that I want to change the names of the sheets is NCRexport and the full path to the folder is C:\Users\sejubru\Desktop\NCR
I also want the macro to close the workbook when it has changed the names of the sheets, could you also add that for me?
Thank you!
I don't understand why you need to change the worksheet names - unless your import code refers to sheet names, in which case why not simply change this, to loop through all the worksheets in the source file, for example? Then the sheet names would be irrelevant.
I bet it would be more efficient using Power Query, too...
Try:
I am assuming that the NCRexport workbook has an "xlsx" extension. Change the extension in the code to suit your needs.![]()
Please Login or Register to view this content.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks