Hello,
I am very new to VBA code. I am trying to write a macro where based on the response of a target cell, a number of rows will hide or unhide. Here is the code that I currently have, and it works.
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("C62") = "Yes" Then
Range("63:84").EntireRow.Hidden = False
End If
If Range("C62") = "No" Then
Range("63:84").EntireRow.Hidden = True
End If
End Sub
However, the response cell "C62" is not always constant. I will often delete or add rows above the response cell. What can I add to update my code after a row addition/deletion?
Thanks.
I am very new to VBA code. I am trying to write a macro where based on the response of a target cell, a number of rows will hide or unhide. Here is the code that I currently have, and it works.
Private Sub Worksheet_Change(ByVal Target As Range)
If Range("C62") = "Yes" Then
Range("63:84").EntireRow.Hidden = False
End If
If Range("C62") = "No" Then
Range("63:84").EntireRow.Hidden = True
End If
End Sub
However, the response cell "C62" is not always constant. I will often delete or add rows above the response cell. What can I add to update my code after a row addition/deletion?
Thanks.