J
J.W. Aldridge
Need to exlude (add to code) sheets "S2" and "S4" sheets along with
"S3".
Option Explicit
Sub testme3()
Dim mysheets
Dim wks As Worksheet
Dim firstselected As Boolean
Set mysheets = ActiveWindow.SelectedSheets
firstselected = False
For Each wks In mysheets
If ucase(wks.Name) = "S3" Then
'do nothing
ElseIf Not firstselected Then
wks.Select
firstselected = True
Else
wks.Select Replace:=False
End If
Next wks
End Sub
"S3".
Option Explicit
Sub testme3()
Dim mysheets
Dim wks As Worksheet
Dim firstselected As Boolean
Set mysheets = ActiveWindow.SelectedSheets
firstselected = False
For Each wks In mysheets
If ucase(wks.Name) = "S3" Then
'do nothing
ElseIf Not firstselected Then
wks.Select
firstselected = True
Else
wks.Select Replace:=False
End If
Next wks
End Sub