LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default usgin a macro within an IF statement

In a general module

Public Function Macro1()
set rng = Application.Caller
Macro1 = rng.Address
End Function

Public Function Macro2()
set rng = Application.Caller
Macro2 = rng.Parent.Name
End Function

Note that a function used in a worksheet can only return a value to the cell
in which it is contained. It can't do formatting or otherwise change the
Excel environment.

--
Regards,
Tom Ogilvy



"fred" wrote in message
...
does anyone know how to use a macro within an IF statement?
for example: If(A2=10,Macro1,Macro2)




 
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
IF Statement in a macro: Damil4real Excel Discussion (Misc queries) 2 August 12th 09 06:28 PM
If Statement to run a macro Secret Squirrel Excel Discussion (Misc queries) 4 July 15th 08 03:43 PM
If statement in macro orquidea Excel Discussion (Misc queries) 2 May 11th 08 08:19 PM
If statement in a Macro Dave Excel Discussion (Misc queries) 1 January 29th 05 12:17 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


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