austenr
08-05-2010, 09:50 AM
I need to conditionally hide and unhide ranges of cells based on a certain condition. I know it goes in the worksheet change event.
Found this code that does rows, but how do you alter it to do say C1:C15 and F1:F15 if the condition is met?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$14" Then
If Target.Value = 1 Then
Rows(10).EntireRow.Hidden = True
Else
Rows(10).EntireRow.Hidden = False
End If
End If
End Sub
Found this code that does rows, but how do you alter it to do say C1:C15 and F1:F15 if the condition is met?
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$14" Then
If Target.Value = 1 Then
Rows(10).EntireRow.Hidden = True
Else
Rows(10).EntireRow.Hidden = False
End If
End If
End Sub