Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run macro from IF function

Hi,
I want to run a macro from an if, how do I do this?


Thanks

Stu



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Run macro from IF function

Stu,

Functions called from worksheet cells can only return a value; they cannot
change the Excel environment in any way, including changing the value of any
cell. The reason is that Excel must keep a model of what cells depend on
what other cells, called the "dependency tree", in order to calculate cells
in the proper order. Since Excel cannot know what cells might be modified by
a VBA macro, it prevents you from changing any cell.

So the short answer is that you can't do this.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
www.cpearson.com


"Stu" wrote in message
...
Hi,
I want to run a macro from an if, how do I do this?


Thanks

Stu



------------------------------------------------
~~ Message posted from
http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/



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
Using A Function in a Macro Jai_Friday Excel Worksheet Functions 2 March 13th 08 01:18 PM
Not sure what function, macro, etc to use Tony Excel Worksheet Functions 2 January 6th 08 06:10 PM
Sub Macro vrs Function Macro Auto Start Pat Excel Discussion (Misc queries) 7 June 6th 07 09:53 PM
Function or macro? Rob N Excel Worksheet Functions 0 August 12th 06 08:14 PM
Macro Function thuva Excel Worksheet Functions 1 July 26th 06 08:02 AM


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