For the following code to work when calling THide_Rows_script sub I have to ws.Activate so each worksheet is selected before I call the sub. Is there a better/faster method of activating the current array ws?
Dim ws As Worksheet
For Each ws In Sheets(Array("qm3", "qt3", "qr3", "qp3", "qu3", "qa3", "qetc3", "qet3", _
"clcrk3", "qgmc3", "qgm3", "rgs3", "rp3", "qsi3", "mr3"))
With ws
ws.Rows("6:200").EntireRow.Hidden = False
ws.Activate
THide_Rows_Script 6, 10
End With
Next ws
Sub THide_Rows_Script(x As Long, y As Long)
Dim LR As Long
Dim rng As Range
Dim rng1 As String
LR = Cells(Rows.Count, y).End(xlUp).Row
With Range(Cells(x, y), Cells(LR, y))
Set rng = .Find("0.00", LookIn:=xlValues, LookAt:=xlWhole)
If Not rng Is Nothing Then
rng1 = rng.Address
Do
rng.EntireRow.Hidden = True
Set rng = .FindNext(rng)
Loop While Not rng Is Nothing
End If
End With
End Sub
Dim ws As Worksheet
For Each ws In Sheets(Array("qm3", "qt3", "qr3", "qp3", "qu3", "qa3", "qetc3", "qet3", _
"clcrk3", "qgmc3", "qgm3", "rgs3", "rp3", "qsi3", "mr3"))
With ws
ws.Rows("6:200").EntireRow.Hidden = False
ws.Activate
THide_Rows_Script 6, 10
End With
Next ws
Sub THide_Rows_Script(x As Long, y As Long)
Dim LR As Long
Dim rng As Range
Dim rng1 As String
LR = Cells(Rows.Count, y).End(xlUp).Row
With Range(Cells(x, y), Cells(LR, y))
Set rng = .Find("0.00", LookIn:=xlValues, LookAt:=xlWhole)
If Not rng Is Nothing Then
rng1 = rng.Address
Do
rng.EntireRow.Hidden = True
Set rng = .FindNext(rng)
Loop While Not rng Is Nothing
End If
End With
End Sub