
Originally Posted by
robinho0d
Hi Paul, I may not have asked my question correctly. Not in all, but only in mentioned ones. If I have, for example, 8 worksheets, I should say in which to perform this action, for example, in 5 selected ones. I don't know how to do I think it was Array("Peaches", "Something else"). Thanks in advance!
If you select multipe tabs (control+click) then this
Sub RemoveOnSelectedWorksheets() ' <<<<<<<<< new sub
Dim i As Long
Dim ws As Worksheet
For i = 1 To ActiveWindow.SelectedSheets.Count
Set ws = ActiveWindow.SelectedSheets(i)
Call DoAllRows(ws)
Next i
End Sub
else something like this (not tested)
Sub RemoveFromArray() ' <<<<<<<<< new sub
Dim i As Long
Dim A As Variant
Dim ws As Worksheet
A = Array("One", "Two", "Three")
For i = Lbound(A) To UBound(A)
Set ws = Worksheets (A(i))
Call DoAllRows(ws)
Next i
End Sub