Select case

H

Hein

I have two drop down menu's on a sheet in excel. By selecting various values
in the drop down menu's will it then trigger different macro's.
I can get it right to write the code for one case selection and it works,
but as soon as I want to add another case selection I get either an end
select or end sub error.

Here's is the code that I am using.:
Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("D6")) Is Nothing Then Exit Sub
Select Case Target.Value
Case "A"
Macro33
Macro1
End select
End sub

Assistance on this will be appreciated.
Thanks
 
M

Mike H

Maybe

Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Me.Range("D6")) Is Nothing Then Exit Sub
Select Case Target.Value
Case "A"
macro33
Case "B"
macro1
Case Else
'not necessary but to show the option
End Select
End Sub

Mike
 
H

Hein

Thanks Mike, but maybe I must re-explain.

I have two dropdown menus's say in range "D6" and "B5". Range "D6" will show
say A or B and range "B5" will show C or D.
They are linked to the following macro's:
A macro1
B macro2
C macro3
D macro4
I can write the code for one range selection i.e. "D6", but how do I add the
range selection of "B5" on my coding?
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top