LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Automatically run a choice of macros based on cell selection


Dear all - many thanks for your help and pointers, I got it to work
fine in the end

Mike


Dave Peterson wrote:
How does the cell change?

If it's by the user typing, you can tie into the worksheet_change() event.

If it's the result of a formula reevaluating, you could use the
worksheet_calculate event.

You can read more about events at:
Chip Pearson's site:
http://www.cpearson.com/excel/events.htm

David McRitchie's site:
http://www.mvps.org/dmcritchie/excel/event.htm

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

wrote:

Thanks Stefi

Will this automatically run if the cell value changes? I'm having
difficulty getting it to work. Do I put the code in a normal module or
the sheet code?

Cheers

Mike

Stefi wrote:
Select Case Range("P7")
Case 1
Call macro1
Case 2
Call macro2
Case 3
Call macro3
End Select
End Sub

Regards,
Stefi


" ezt írta:

I need to run a macro based on whether cell P7 in a worksheet contains
value 1, 2 or 3.

If cell contains value 1, would automatically run Macro1, if 2 would
run Macro2, and if 3 then run Macro3.

Can anyone tell me how to do this?



--

Dave Peterson


 
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
Automatically filling a cell from a worksheet based on a selection Pbrent Excel Worksheet Functions 2 May 14th 10 03:39 PM
Force entry into cell, based on validation selection in adjacent cell Richhall[_2_] Excel Worksheet Functions 3 June 18th 09 10:28 AM
Selecting a cell entry based on cell validation selection Brutalius Excel Worksheet Functions 2 December 17th 08 03:44 AM
limit cell list selection based on the selection of another list lorraine Excel Worksheet Functions 2 December 14th 04 08:17 PM
Excel data entry: choice of control for selection David Powell Excel Programming 3 August 13th 03 06:08 PM


All times are GMT +1. The time now is 01:58 AM.

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"