Guitarde
Board Regular
- Joined
- Mar 18, 2003
- Messages
- 244
Hello,
I am trying to select all the sheets that would be included between tab A and tab Z
Essentially same as when selecting manually while holding CTRL
So far this is selecting the right sheet but only one at the time, how can I all sheets between 4 & 9 ?
I do not want to select the sheet, i want to add it to the sheet selection.
Sub Full_set()
'Identify from which sheet to start and where to end
vStart = Sheets("A").Index '4
vFinish = Sheets("Z").Index '9
For Each WS In ThisWorkbook.Worksheets
If WS.Index > vStart And WS.Index < vFinish Then
WS.Select
Else
'WS.Select False
End If
Next WS
End sub
Thanks for your help!
I am trying to select all the sheets that would be included between tab A and tab Z
Essentially same as when selecting manually while holding CTRL
So far this is selecting the right sheet but only one at the time, how can I all sheets between 4 & 9 ?
I do not want to select the sheet, i want to add it to the sheet selection.
Sub Full_set()
'Identify from which sheet to start and where to end
vStart = Sheets("A").Index '4
vFinish = Sheets("Z").Index '9
For Each WS In ThisWorkbook.Worksheets
If WS.Index > vStart And WS.Index < vFinish Then
WS.Select
Else
'WS.Select False
End If
Next WS
End sub
Thanks for your help!