View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Karin Karin is offline
external usenet poster
 
Posts: 125
Default Macro with List Box Selection

I'm so excited I figured it out myself by searching more on this board!
here's what worked. The macros are in Module 1 and this code is on the
worksheet.

I can't seem to get the Case to be an "or" (since 3 call the same macro)

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Range("D5"), Target) Is Nothing Then
Select Case Target.Value
'unlock & unshade for Audit
Case "Apple": Call UnlockUnshade
' Lock & shade for Review
Case "Beets": Call LockShade
' Lock & shade for Compilation
Case "Carrots": Call LockShade
' Lock & shade for Other
Case "Other": Call LockShade
End Select
End If
End Sub


"Karin" wrote:

I should add that it is a data validation list in merged cells D5:E5.

"Karin" wrote:

Hi,
I have a list box with 4 items. I have two macros - MacA and MacB. If item
Apple is selected in the box, I want to run MacA, if any of the other 3 items
are selected I want to run MacB. I could use a nudge (or more) to get going
in the right direction
Thank you
Karin R