I'm using the following Array to go through a specific number of open sheets to add a specific range of cells.
What I have is working but sometimes the number of open sheets is different so I have to edit the macro to define how many sheets I want to add each time.
How can I either enter a number of sheets that are open (for example, this is 13 open sheets) or make it run no mater how many sheets are open?
Please help
Sub Add()
'
' Add Macro
'
Dim myValue As String
myValue = InputBox("Job Number?")
sheetlist = Array("Time Sheet", "Time Sheet (2)", "Time Sheet (3)", "Time Sheet (4)", "Time Sheet (5)", "Time Sheet (6)", "Time Sheet (7)", "Time Sheet (8)", "Time Sheet (9)", "Time Sheet (10)", "Time Sheet (11)", "Time Sheet (12)", "Time Sheet (13)")
For i = LBound(sheetlist) To UBound(sheetlist)
Worksheets(sheetlist(i)).Activate
'
ActiveSheet.Unprotect
What I have is working but sometimes the number of open sheets is different so I have to edit the macro to define how many sheets I want to add each time.
How can I either enter a number of sheets that are open (for example, this is 13 open sheets) or make it run no mater how many sheets are open?
Please help
Sub Add()
'
' Add Macro
'
Dim myValue As String
myValue = InputBox("Job Number?")
sheetlist = Array("Time Sheet", "Time Sheet (2)", "Time Sheet (3)", "Time Sheet (4)", "Time Sheet (5)", "Time Sheet (6)", "Time Sheet (7)", "Time Sheet (8)", "Time Sheet (9)", "Time Sheet (10)", "Time Sheet (11)", "Time Sheet (12)", "Time Sheet (13)")
For i = LBound(sheetlist) To UBound(sheetlist)
Worksheets(sheetlist(i)).Activate
'
ActiveSheet.Unprotect