[mso] Re: Using IF to select Macro command to carry out? Possible?

  • From: "Ray Blake" <ray@xxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Tue, 17 May 2005 21:19:16 +0100

No, you can't do this. If you think about it, the effect of this - if
you could do it - would be to run your macro every time the sheet
updates. If you want that to happen (unlikely!) you can trigger the
macro from the change/update event of the worksheet, but what's more
likely is that you want to run it only when the value in a certain cell
changes.

If you're in Dian's Yahoo Excel VBA group, there's a file sample
available on the group home page which shows exactly how this is done.
All you'll need to do is build in a Select Case structure to trigger the
right macro.

Ray

------------------------------------
GR Business Process Solutions
Ray Blake
Head of Software Design
ray@xxxxxxxxx
Braedon
Newell Road
Hemel Hempstead
Herts HP3 9PD
tel: 01442 396518
fax: 01442 389353
mobile: 07834 226601
www.grbps.com
------------------------------------


-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On
Behalf Of Robert Carneal
Sent: 17 May 2005 21:12
To: mso@xxxxxxxxxxxxx
Subject: [mso] Using IF to select Macro command to carry out? Possible?


In Excel 2000, say I have five macro commands. I will call them
Firsttrip, Secondtrip, Thirdtrip, Fourthtrip, Fifthtrip, SixthTrip,
SeventhTrip, WrongTrip

This is illegal in Excel, but please bear with me:

A6=4
=Choose(A6, Firsttrip, Secondtrip, Thirdtrip, Fourthtrip, Fifthtrip,
SixthTrip, SeventhTrip)

So whenever A6 is 4, run the macro FourthTrip. Possible? I can use
Choose with values and formulas, but what about macros?

Thank you.

Robert


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: