Hi,
I have a sheet that has columns A:CJ and over 2,000 rows. Columns A-E contain data throughout the 2,000 rows. I want to create a macro, that hides any row that contains blank data from F:CJ.
This is what I have so far and its still hiding rows that contain data:
Sub hideblankrowsincol()
Dim myRg As Range
Set myRg = Range([F4:CJ4].End(xlDown), [A65536:CJ65536].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
I have a sheet that has columns A:CJ and over 2,000 rows. Columns A-E contain data throughout the 2,000 rows. I want to create a macro, that hides any row that contains blank data from F:CJ.
This is what I have so far and its still hiding rows that contain data:
Sub hideblankrowsincol()
Dim myRg As Range
Set myRg = Range([F4:CJ4].End(xlDown), [A65536:CJ65536].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