Andy_H1965
New Member
- Joined
- Oct 31, 2018
- Messages
- 3
Hi there
I'm having an issue with a VBA macro- the first half works, however the second 'rule' isn't (in bold type below). I've scoured the forums but can't find an answer.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("C23")) Is Nothing Then Exit Sub
Select Case Target.Value
Case "Contractor", "Panel Builder"
ActiveSheet.Rows("63:66").Hidden = False
Case "OEM", "System Integrator"
ActiveSheet.Rows("63:66").Hidden = True
ActiveSheet.Rows("48:49").Hidden = False
ActiveSheet.Rows("51").Hidden = True
End Select
If Intersect(Target, Range("C9")) Is Nothing Then Exit Sub
Select Case Target.Value
Case "Amend"
ActiveSheet.Row("55").Hidden = False
Case "New", "Close", "Transfer"
ActiveSheet.Row("55").Hidden = True
End Select
End Sub
So, basically trying to hide row 55 if the value of cell C9 meets criteria, but it just won't work for me.
Any ideas?? I'm probably missing something really simple but struggling to find the answer. Thanks in advance
I'm having an issue with a VBA macro- the first half works, however the second 'rule' isn't (in bold type below). I've scoured the forums but can't find an answer.
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("C23")) Is Nothing Then Exit Sub
Select Case Target.Value
Case "Contractor", "Panel Builder"
ActiveSheet.Rows("63:66").Hidden = False
Case "OEM", "System Integrator"
ActiveSheet.Rows("63:66").Hidden = True
ActiveSheet.Rows("48:49").Hidden = False
ActiveSheet.Rows("51").Hidden = True
End Select
If Intersect(Target, Range("C9")) Is Nothing Then Exit Sub
Select Case Target.Value
Case "Amend"
ActiveSheet.Row("55").Hidden = False
Case "New", "Close", "Transfer"
ActiveSheet.Row("55").Hidden = True
End Select
End Sub
So, basically trying to hide row 55 if the value of cell C9 meets criteria, but it just won't work for me.
Any ideas?? I'm probably missing something really simple but struggling to find the answer. Thanks in advance