so Excel looks at the modules first and foremost
I don't think this is strictly true.
The scope of the variable in relation to the codes location is what is used.
Your example had the variable Startdate declared in 2 locations. Thisworkbook and Sheet1.
So the routine Workbook_Open() in Thisworkbook used the variable declared at the top of the Thisworkbook module.
In Sheet1 the variable declared at the top of Sheet1 code module was used in the Worksheet_Change event.
Both of the following would have been valid syntax and returned the value contained by each variable.
Thisworkbook.StartDate
Sheet1.StartDate
If you modified Sheet1 code to and change the sheet first time will get protected and after removing protection the code will work as intended.
If you add this code to a standard code module.
Run before changing sheet1 and you can see the held values of both variables.
Bookmarks