Team ,
I have below VBA code to hide few rows in excel but 2nd code in this is not working in combination with first one . When I do it separately its working fine . Any Suggestions ?
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B7")) Is Nothing Then Exit Sub
If Target = "Y" Then
Rows("17:22").Hidden = True
Rows("11:15").Hidden = False
ElseIf Target = "N" Then
Rows("11:15").Hidden = True
Rows("17:22").Hidden = False
End If
If Intersect(Target, Range("B39")) Is Nothing Then Exit Sub
If Target = "Y" Then
Rows("40:40").Hidden = True
Rows("41:41").Hidden = False
ElseIf Target = "N" Then
Rows("41:41").Hidden = True
Rows("40:40").Hidden = False
End If
End Sub
I have below VBA code to hide few rows in excel but 2nd code in this is not working in combination with first one . When I do it separately its working fine . Any Suggestions ?
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B7")) Is Nothing Then Exit Sub
If Target = "Y" Then
Rows("17:22").Hidden = True
Rows("11:15").Hidden = False
ElseIf Target = "N" Then
Rows("11:15").Hidden = True
Rows("17:22").Hidden = False
End If
If Intersect(Target, Range("B39")) Is Nothing Then Exit Sub
If Target = "Y" Then
Rows("40:40").Hidden = True
Rows("41:41").Hidden = False
ElseIf Target = "N" Then
Rows("41:41").Hidden = True
Rows("40:40").Hidden = False
End If
End Sub