Hi experts,
I'm looking for help to a problem I have. I am tring to create some code to help me keep visible or hide rows based on a value. I have achieved the following but am struggling.
Sub HideRowscategory_1()
Dim lstRng As Range
Dim c As Range
Set lstRng = Range("CC11", Range("CC310").End(xlUp))
For Each c In lstRng
If c.Value = Range("CC1").Value Then
c.EntireRow.Hidden = False
End If
Next c
End Sub
What I'm looking to do is if c.value = Range("CC1").value then that row plus the row below it remain visible. Otherwise I want the row (plus the one below it) to become hidden.
Any advice or help much appreciated.
Thanks to anyone who looks or tries to help.
Soggy40
I'm looking for help to a problem I have. I am tring to create some code to help me keep visible or hide rows based on a value. I have achieved the following but am struggling.
Sub HideRowscategory_1()
Dim lstRng As Range
Dim c As Range
Set lstRng = Range("CC11", Range("CC310").End(xlUp))
For Each c In lstRng
If c.Value = Range("CC1").Value Then
c.EntireRow.Hidden = False
End If
Next c
End Sub
What I'm looking to do is if c.value = Range("CC1").value then that row plus the row below it remain visible. Otherwise I want the row (plus the one below it) to become hidden.
Any advice or help much appreciated.
Thanks to anyone who looks or tries to help.
Soggy40