Bonjour guys,
hope you can help me with the below?
I have this code below working for one given range (e.g. For Each A In Range("AE4:AE500") but as soon as I try adding more ranges to loop through, it gets stuck.
any idea why?
the code needs to check all ranges and only if all ranges are not blank then it should hide the relevant row.
Sub Hide_Rows_Containing_Value()
Application.ScreenUpdating = False
Dim A As Range
For Each A In Range("AE4:AE500" & "AF4:AF500" & "AG4:AG500" & "AH4:AH500" & "AI4:AI500").Cells
If A.Value <> "" Then
A.EntireRow.Hidden = True
End If
Next A
Application.ScreenUpdating = True
End Sub
cheers for your help,
Mike
hope you can help me with the below?
I have this code below working for one given range (e.g. For Each A In Range("AE4:AE500") but as soon as I try adding more ranges to loop through, it gets stuck.
any idea why?
the code needs to check all ranges and only if all ranges are not blank then it should hide the relevant row.
Sub Hide_Rows_Containing_Value()
Application.ScreenUpdating = False
Dim A As Range
For Each A In Range("AE4:AE500" & "AF4:AF500" & "AG4:AG500" & "AH4:AH500" & "AI4:AI500").Cells
If A.Value <> "" Then
A.EntireRow.Hidden = True
End If
Next A
Application.ScreenUpdating = True
End Sub
cheers for your help,
Mike