Hello,
I am very new to VBA and looking for help hiding rows if the the first cell (Column A) in the row (7-72) is zero. I would also like to unhide the rows if the cell is not zero and ideally not have to manually run the code each time the values in column A change. Column A is dependent on changes to two cells on another sheet 'Client Profile'!C4:C5.
This is not working as of now but I have pieced together the following:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "'Client Profile'!C4:C5" Then
Application.ScreenUpdating = False
Application.Calculation = xlManual
For Each c In Range("A7:A72")
If c.Value = 0 Then Rows(c.Row).Hidden = True
Next
For Each c In Range("A7:A72")
If c.Value > 1 Then Rows(c.Row).Hidden = False
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
End If
End Sub
I am very new to VBA and looking for help hiding rows if the the first cell (Column A) in the row (7-72) is zero. I would also like to unhide the rows if the cell is not zero and ideally not have to manually run the code each time the values in column A change. Column A is dependent on changes to two cells on another sheet 'Client Profile'!C4:C5.
This is not working as of now but I have pieced together the following:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "'Client Profile'!C4:C5" Then
Application.ScreenUpdating = False
Application.Calculation = xlManual
For Each c In Range("A7:A72")
If c.Value = 0 Then Rows(c.Row).Hidden = True
Next
For Each c In Range("A7:A72")
If c.Value > 1 Then Rows(c.Row).Hidden = False
Application.Calculation = xlAutomatic
Application.ScreenUpdating = True
End If
End Sub