cmefly
Well-known Member
- Joined
- May 13, 2003
- Messages
- 683
Hi,
I've got a drop-down menu (using forms not a listbox) in A1. In B1, i've got a vlookup formula that is dependent on A1. So when A1 changes, so does the value in B1.
I need a macro that is triggered only when B1 changes.
In my case, B1 can be x, y, or z. Each one would trigger a different macro.
I've got this but it doesn't work...any ideas?
Private Sub Worksheet_Change(ByVal Target As Range)
Target = Range("b1")
If Target.Value = "x" Then
MACRO1
End If
If Target.Value = "y" Then
MACRO2
End If
If Target.Value = "z" Then
MACRO3
End If
End Sub
I've got a drop-down menu (using forms not a listbox) in A1. In B1, i've got a vlookup formula that is dependent on A1. So when A1 changes, so does the value in B1.
I need a macro that is triggered only when B1 changes.
In my case, B1 can be x, y, or z. Each one would trigger a different macro.
I've got this but it doesn't work...any ideas?
Private Sub Worksheet_Change(ByVal Target As Range)
Target = Range("b1")
If Target.Value = "x" Then
MACRO1
End If
If Target.Value = "y" Then
MACRO2
End If
If Target.Value = "z" Then
MACRO3
End If
End Sub