MAJ0RMAJ0R75
New Member
- Joined
- Aug 10, 2011
- Messages
- 2
Hi there,
I've been searching the net for a solution to my problem, however given my lack of understanding of VBA, have not been able to decipher solutions to similar problems previously posted.
I have created a form in Excel, which contains a number of drop down lists. I have also saved a number of macros which I would like to activate upon specific drop down selections being made. I have been able to get a set of macros to work on one drop down by using the following code:
I have read however that you can only use one instance of Private Sub Worksheet_Change(ByVal Target As Range) per worksheet.
I'd like to combine multiple instances of this code to different drop downs, for example adding the code below to the one above:
I have read that the CASE statement can do this, but cannot work out how to translate what I want to achieve into the code.
Hopefully someone out there can offer a solution.
Many thanks in anticipation.
I've been searching the net for a solution to my problem, however given my lack of understanding of VBA, have not been able to decipher solutions to similar problems previously posted.
I have created a form in Excel, which contains a number of drop down lists. I have also saved a number of macros which I would like to activate upon specific drop down selections being made. I have been able to get a set of macros to work on one drop down by using the following code:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$17" Then
If Target = "Ex Factory" Then
Exf
ElseIf Target = "" Then
noexf
ElseIf Target = "Delivered" Then
noexf
ElseIf Target = "Delivered & Installed" Then
noexf
End If
End If
End Sub
I have read however that you can only use one instance of Private Sub Worksheet_Change(ByVal Target As Range) per worksheet.
I'd like to combine multiple instances of this code to different drop downs, for example adding the code below to the one above:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$C$3" Then
If Target = "Contract Review" Then
CR
ElseIf Target = "" Then
BR
ElseIf Target = "Bid Review" Then
BR
End If
End If
End Sub
I have read that the CASE statement can do this, but cannot work out how to translate what I want to achieve into the code.
Hopefully someone out there can offer a solution.
Many thanks in anticipation.