I am using this code
Private Sub Worksheet_Activate()
Dim myRg As Range
'Change the [A1], [A65536] to your range
Set myRg = Range([B1].End(xlDown), [B65536].End(xlUp))
On Error Resume Next
Set myRg = myRg.SpecialCells(4)
If Err = 0 Then
myRg.EntireRow.Hidden = True
Else
MsgBox "No blanks"
End If
Set myRg = Nothing
End Sub
This works Very fast
On another sheet I would like to add a formula in column H That puts a 1 in rows I want to keep and "" in rows I want to hide how do I change Set myRg = myRg.SpecialCells(4)
Private Sub Worksheet_Activate()
Dim myRg As Range
'Change the [A1], [A65536] to your range
Set myRg = Range([B1].End(xlDown), [B65536].End(xlUp))
On Error Resume Next
Set myRg = myRg.SpecialCells(4)
If Err = 0 Then
myRg.EntireRow.Hidden = True
Else
MsgBox "No blanks"
End If
Set myRg = Nothing
End Sub
This works Very fast
On another sheet I would like to add a formula in column H That puts a 1 in rows I want to keep and "" in rows I want to hide how do I change Set myRg = myRg.SpecialCells(4)
Last edited: