Hi,
I have a macro Sub Worksheet_Change(ByVal Target As Range) which runs when cell A4 is changed see code below:
I would now like to add another condition so that if cell B8 changes then some rows are hidden.
Code would look like one below:
How can I combine these two pieces of code?
If I add second one I get Compile error: "Ambiguous name detected: worksheet_change"
Many Thanks,
Nic
I have a macro Sub Worksheet_Change(ByVal Target As Range) which runs when cell A4 is changed see code below:
VBA Code:
Sub worksheet_change(ByVal target As Range)
Set target = Range("A4")
If target.Value = "Escalation Form" Then
Call Expand
End If
If target.Value = "Relationship Profile Summary Form" Then
Call Collapse
End If
End Sub
I would now like to add another condition so that if cell B8 changes then some rows are hidden.
Code would look like one below:
Code:
Sub worksheet_change(ByVal target As Range)
Set target = Range("B8")
If target.Value = "Counterparty" Then
Call Hide
End If
If target.Value = "Client" Then
Call Unhide
Call Paste
End If
If target.Value = "Business Partner" Then
Call Unhide
Call Paste
End If
End Sub
How can I combine these two pieces of code?
If I add second one I get Compile error: "Ambiguous name detected: worksheet_change"
Many Thanks,
Nic