I declare Sheet4m as string, then...
Sheet4m = ThisWorkbook.VBProject.VBComponents(ActiveSheet.CodeName).Name
If the active sheet is sheet 1, then Sheet4m properly stores "Sheet1," but if sheet 2 is the active sheet, then I get a run time error '9': subscript out of range.
What is the issue?
Bookmarks