LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #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....



 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
event macros vs copy/paste Dave Excel Worksheet Functions 2 November 17th 08 02:36 AM
Working with Macros - Help needed!!! The Greek Excel Discussion (Misc queries) 2 November 19th 06 05:39 PM
Event Macro adjustment needed - need to change font color also nick s Excel Worksheet Functions 2 November 28th 05 05:50 PM
formula needed to track dates event happened ilmeaz Excel Worksheet Functions 1 November 15th 05 02:52 AM
event macros - xl 2003 Sue Excel Worksheet Functions 8 November 7th 05 07:46 AM


All times are GMT +1. The time now is 03:55 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"