Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default running macros

Can a macro be run from within a formula?
I would like to run macro A if a cell contains 0 or macro B if that cell
contains anything else.
I know how to setup the NOT formula, but how do you program arguments to get
the macros to run? Is there a way to do that?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,942
Default running macros

hi.
short answer....no.
you can write functions in vba that the cell can call but these functions
return value and cannot perform actions.
you might be able to use the worksheet change event to fire a macro but only
if the value in the cell is changed manually. it will not fire with a
formula change.
There is the calculation event but that would probable fire your macro every
time the sheet recalculated. (eeee!)
so if you could provide a bit more info as to what your are trying to do,
someone might be able to suggest a alternative course of actions.

Regards
FSt1

"piglaup" wrote:

Can a macro be run from within a formula?
I would like to run macro A if a cell contains 0 or macro B if that cell
contains anything else.
I know how to setup the NOT formula, but how do you program arguments to get
the macros to run? Is there a way to do that?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default running macros

You can use the Workbook_SheetCalculate event or Workbook_SheetChange event
to check the value and call the appropriate macro


If this post helps click Yes
---------------
Jacob Skaria


"piglaup" wrote:

Can a macro be run from within a formula?
I would like to run macro A if a cell contains 0 or macro B if that cell
contains anything else.
I know how to setup the NOT formula, but how do you program arguments to get
the macros to run? Is there a way to do that?

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
Running Macros No Name Excel Programming 2 July 10th 06 09:16 PM
Macros not running StephanieH Excel Programming 2 December 14th 04 01:39 PM
Running Macros Steve Excel Programming 5 September 21st 04 02:54 PM
Running Win Macros on Mac wammer[_2_] Excel Programming 4 August 7th 04 06:29 AM
HELP: Running two Macros, one before the other Bobbak Excel Programming 3 December 8th 03 02:08 PM


All times are GMT +1. The time now is 01:35 PM.

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

About Us

"It's about Microsoft Excel"