Glasgowsmile
Active Member
- Joined
- Apr 14, 2018
- Messages
- 280
- Office Version
- 365
- Platform
- Windows
Hello,
I have a project that is currently only 1 sheet. I'm using Sheets(1) to reference it so I don't have to worry about what it is named. However, in the future, this single sheet may be copied up to 30 times and the sheet names changed each time. Instead of manually changing all of them to Sheets(2), Sheets(3)... etc, how can I capture the Codename or Sheet name with VBA and then use as the active sheet for the rest of my formula?
Does something like this work? I've tried it but with no success so I wonder what I'm missing.
I have a project that is currently only 1 sheet. I'm using Sheets(1) to reference it so I don't have to worry about what it is named. However, in the future, this single sheet may be copied up to 30 times and the sheet names changed each time. Instead of manually changing all of them to Sheets(2), Sheets(3)... etc, how can I capture the Codename or Sheet name with VBA and then use as the active sheet for the rest of my formula?
Does something like this work? I've tried it but with no success so I wonder what I'm missing.
VBA Code:
shName = ActiveSheet.Name