Hello,
I am attempting to create a Microsoft Excel Object (Sheet Name) in VBA using concatenation. I would like to create a macro which in part loops through different sheets by Sheet Number.
For i = 1 To 10
SheetNumber = Sheet & i
...
SheetNumber.Activate
I would like to make "SheetNumber" become the sheet name in the Object panel. It should become Sheet1, Sheet2, Sheet3...
Currently, it concatenates to just i, because Sheet is blank. If I instead change it to:
For i = 1 To 10
SheetNumber = "Sheet" & i
...
SheetNumber.Activate
it becomes "Sheet1", "Sheet2", "Sheet3"... This also gives me an error.
Does anyone have any suggestions? I have to use the concatenation as opposed to Sheets(i).
Thanks!
I am attempting to create a Microsoft Excel Object (Sheet Name) in VBA using concatenation. I would like to create a macro which in part loops through different sheets by Sheet Number.
For i = 1 To 10
SheetNumber = Sheet & i
...
SheetNumber.Activate
I would like to make "SheetNumber" become the sheet name in the Object panel. It should become Sheet1, Sheet2, Sheet3...
Currently, it concatenates to just i, because Sheet is blank. If I instead change it to:
For i = 1 To 10
SheetNumber = "Sheet" & i
...
SheetNumber.Activate
it becomes "Sheet1", "Sheet2", "Sheet3"... This also gives me an error.
Does anyone have any suggestions? I have to use the concatenation as opposed to Sheets(i).
Thanks!