Pookiemeister
Well-known Member
- Joined
- Jan 6, 2012
- Messages
- 626
- Office Version
- 365
- 2010
- Platform
- Windows
I am getting a "Run-time error '9': Subscript out of range" on the following code:
The worksheet name is Exhibit "I". If I remember correctly about what that run-time error means, on this line of code its saying it can't find a sheet with that name to activate. I have a feeling it has something to due with all the quotes around the letter (I). Unfortunately, I can not rename this spreadsheet because it is within a public file on a server and I'm not the author of it. I tried different ways to change the worksheet name like adding in single quotes(') instead of double quotes(") but VBA would change that line of code to RED Letters. The only way I could rename the worksheet above so that entire line of code wouldn't be in RED Letters was to position the quotes as shown above. But it still gave me a Run-time error '9'. I never dealt with worksheet names with quotes in them so I'm at a loss on to fix this error. Thank you.
Code:
Worksheets("Exhibit ""I""").Activate