Hi,
I am new to the VBA but would like to do simple thing with VBA: when specific cell has certain text on it, rows below are unhidden and when cell has something else those rows are hidden.
This macro should work automatically without running the macros manually.
I have tried several things but nothing seems to do the trick. Perhaps the issue is with VBA options, I do not know.
This is an example what I am trying to accomplish: When user selects Yes in cell C4 then row 6 is visible. Otherwise row 6 should be hidden.
Would be really pleased to have some assistance!
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("C4").Value = "Yes" Then
Rows("6:6").EntireRow.Hidden = False
Else
Rows("6:6").EntireRow.Hidden = True
End If
End Sub
I am new to the VBA but would like to do simple thing with VBA: when specific cell has certain text on it, rows below are unhidden and when cell has something else those rows are hidden.
This macro should work automatically without running the macros manually.
I have tried several things but nothing seems to do the trick. Perhaps the issue is with VBA options, I do not know.
This is an example what I am trying to accomplish: When user selects Yes in cell C4 then row 6 is visible. Otherwise row 6 should be hidden.
Would be really pleased to have some assistance!
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("C4").Value = "Yes" Then
Rows("6:6").EntireRow.Hidden = False
Else
Rows("6:6").EntireRow.Hidden = True
End If
End Sub