SandsB
Well-known Member
- Joined
- Feb 13, 2007
- Messages
- 705
- Office Version
- 365
- Platform
- Windows
I inherited 132 files all in the same folder. There are files for each month of the year and within each file there are tabs for each day of a month. Each file has the month in the filename and they're all named in this format:
XXX-# MMM YYYY.xlsx where XXX could be several different things but always 3 characters and # is either 1, 2 or 3.
Right now, all the tabs in every file are named for days in August. 08-01, 08-02, 08-03, etc. But - I need the September file's tabs named 09-01, 09-02, 09-03, etc and the November files named 11-01, 11-02,......
So in files for January in a file named PER-1 JAN 2020.xlsx there are tabs named 08-01, 08-02, 08-03, etc but I need them renamed to 01-01, 01-02, 01-03, etc.
Same for PAT-2 JAN 2020.xls and FR1-3 JAN 2020.xls. Etc, Etc, Etc,.
Can somebody show me a macro that'll rename the tabs based on the filename? Or even something that allows me to open each file individually and change the month to the correct number in the macro would be better than manually renaming thousands of tabs.
TIA
XXX-# MMM YYYY.xlsx where XXX could be several different things but always 3 characters and # is either 1, 2 or 3.
Right now, all the tabs in every file are named for days in August. 08-01, 08-02, 08-03, etc. But - I need the September file's tabs named 09-01, 09-02, 09-03, etc and the November files named 11-01, 11-02,......
So in files for January in a file named PER-1 JAN 2020.xlsx there are tabs named 08-01, 08-02, 08-03, etc but I need them renamed to 01-01, 01-02, 01-03, etc.
Same for PAT-2 JAN 2020.xls and FR1-3 JAN 2020.xls. Etc, Etc, Etc,.
Can somebody show me a macro that'll rename the tabs based on the filename? Or even something that allows me to open each file individually and change the month to the correct number in the macro would be better than manually renaming thousands of tabs.
TIA