#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default validation


how do I write code to have a macro "fire" when a validated cell i
changed? I have a list of three options in a validated cell and I wan
different macros to "fire" when different options are selected from th
validated cell list.

I am a newbie so as much detail as possible is appreciated.

Thanks

--
bforster
-----------------------------------------------------------------------
bforster1's Profile: http://www.excelforum.com/member.php...fo&userid=1177
View this thread: http://www.excelforum.com/showthread.php?threadid=26575

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default validation

right click on the sheet tab and select view code.

Use the Change event (in Excel 2000 and later)

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If target.Count 1 then exit sub
' is it the validated cell
if target.Address = "$B$9" then
Select Case Lcase(Target.Value)
Case "value1"
Macro1
Case "value2"
Macro2
Case "value3"
Macro3
End Select
End If
End Sub

See Chip Pearson's site for information on events
http://www.cpearson.com/excel/events.htm

--
Regards,
Tom Ogilvy

"bforster1" wrote in message
...

how do I write code to have a macro "fire" when a validated cell is
changed? I have a list of three options in a validated cell and I want
different macros to "fire" when different options are selected from the
validated cell list.

I am a newbie so as much detail as possible is appreciated.

Thanks.


--
bforster1
------------------------------------------------------------------------
bforster1's Profile:

http://www.excelforum.com/member.php...o&userid=11771
View this thread: http://www.excelforum.com/showthread...hreadid=265753



Reply
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
Validation Data using Validation Table cell range..... Dermot Excel Discussion (Misc queries) 16 January 5th 10 09:35 PM
data validation invalid in dynamic validation list ilia Excel Discussion (Misc queries) 0 November 7th 06 12:54 PM
Validation (Drop down list vs simple text length validation) Bob Phillips[_6_] Excel Programming 2 April 27th 04 07:47 PM
Validation (Drop down list vs simple text length validation) Jason Morin[_2_] Excel Programming 1 April 27th 04 04:56 PM
Validation (Drop down list vs simple text length validation) Pete McCosh Excel Programming 0 April 27th 04 03:49 PM


All times are GMT +1. The time now is 12:09 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"