I am VERY new at VBA and have been searching for VBA code that can do what I want. I have tried several and attempted to adapt them however I just can't seem to get them right so thought I would try for some help!
I have 6 projects that have either YES or NO in the cell next to them indicating if the person is working on that project. This is determined by the persons name next to that project on another sheet, so is formula produced and not a drop down or typed in value.
The project then has a few rows below corresponding to it.
If there is a NO next to a project (in C6), I want the corresponding rows for that project to be hidden (rows 13:29).
I want this to be repeated for each project,
so a no in c7 hides 31:47, a no in C8 hides 49:65, a no in C9 hides 67:83, a no in C10 hides 85:101, a no in C11 hides 103:118,
I don't know if this is possible and have been going around in circles, really hope that someone can help :)
this is one of the adaptions i have tried but i am sure i am doing something wrong, sorry for not posting this here before
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$6" Then
If Target.Value = NO Then
Rows(13:29).EntireRow.Hidden = True
Else
Rows(13:29).EntireRow.Hidden = False
If Target.Address = "$C$7" Then
If Target.Value = NO Then
Rows(31:47).EntireRow.Hidden = True
Else
Rows(31:47).EntireRow.Hidden = False
End If
End If
If Target.Address = "$C$8" Then
If Target.Value = NO Then
Rows(49:65).EntireRow.Hidden = True
Else
Rows(49:65).EntireRow.Hidden = False
End If
End If
If Target.Address = "$C$9" Then
If Target.Value = NO Then
Rows(67:83).EntireRow.Hidden = True
Else
Rows(67:83).EntireRow.Hidden = False
End If
End If
If Target.Address = "$C$10" Then
If Target.Value = NO Then
Rows(85:101).EntireRow.Hidden = True
Else
Rows(85:101).EntireRow.Hidden = False
End If
End If
If Target.Address = "$C$11" Then
If Target.Value = NO Then
Rows(103:119).EntireRow.Hidden = True
Else
Rows(103:119).EntireRow.Hidden = False
End If
End If
End Sub