Hi everyone,
Hi from Middle Earth again.
I am stuck in something probably extremely easy:
Stops in the
Sheets("sheet_name").Select
line...
How do you refer a newly automatically created worksheet if the name will be changing? I was thinking the variable "sheet_name" will be the one to "call" when you want to go to that worksheet?
What am I missing?
Dan
Hi from Middle Earth again.
I am stuck in something probably extremely easy:
VBA Code:
'Creates Invoice Worksheet
sheet_name = shMacros.Range("A24:A33").Cells(i, 1).Value
Sheets.Add.Name = sheet_name
'Copy data from InvSample to Invoice Sheet
Sheets("sheet_name").Select
Cells.Select
With Selection.Interior
.Pattern = xlSolid
.PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorDark1
.TintAndShade = 0
.PatternTintAndShade = 0
End With
Stops in the
Sheets("sheet_name").Select
line...
How do you refer a newly automatically created worksheet if the name will be changing? I was thinking the variable "sheet_name" will be the one to "call" when you want to go to that worksheet?
What am I missing?
Dan