Thread: Select case
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Select case

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

"Hein" wrote:

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