Excel VBA set sheet name at auto_open routine
Posted on 2013-01-05
I have my auto_open routine set - but I want to add additional code to ensure that my sheet names were not changed by an enduser. If they were changed - then I want to reset them back to their original name on open. I do not have the workbook protected, just the individual sheets.
I have 5 worksheets where the name should stay the same. (The code.names are no longer sheet1 sheet 2) The code.names are set as follows:
week1, week2, week3, week4 & week5
In my open routine - I want to rename any worksheet that may have been changed by referencing it by it's codename. Listed below are the code.name with the respective worksheet names.
week1 = "week 1"
week2 = "week 2"
Is this possible to do this?