View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
edo edo is offline
external usenet poster
 
Posts: 5
Default Event Macros Help Needed

Thanks Gary. I figured out where to put the code into the worksheet. What
happens next?

"Gary''s Student" wrote:

Put something like this event macro in the worksheet code area:

Private Sub Worksheet_Change(ByVal Target As Range)
Set t = Target
Set a1 = Range("A1")
If Intersect(t, a1) Is Nothing Then Exit Sub
Application.EnableEvents = False
Select Case t.Value
Case "dog"
i = 3
Case "cat"
i = 5
Case "bird"
i = 10
Case "fish"
i = 6
End Select
t.Interior.ColorIndex = i
Application.EnableEvents = True
End Sub
--
Gary''s Student - gsnu200835


"edo" wrote:

Is it possible to create a formula to have items in a dropdown menu in a cell
automatically change to a certain color when selected? There are more than 3
colors so Conditioning Format will not work for this....