Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Macros - call or launch from fromula

can I launch or call a macro from an @IF() statement in a
cell? If so, what is the propoer synatax.

Thanks

B. Paul Welch
San Diego
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Macros - call or launch from fromula

No, you can't launch a macro as the result of an IF statement. However, take
a look at worksheet events - these are probably what you need.

--

Regards
Andy Wiggins
www.BygSoftware.com
Home of "The Excel Auditor" and "Byg Tools for VBA"



"Paul" wrote in message
...
can I launch or call a macro from an @IF() statement in a
cell? If so, what is the propoer synatax.

Thanks

B. Paul Welch
San Diego



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Macros - call or launch from fromula

Paul; you can create a user-defined function (UDF) which is callable from
within your =IF function....

For example, if you'd like to create an IF function that checks if the text
color in a particular cell is red, you could write something like this:

Function CheckColor(CellRef As String)
Dim CC As Long
On Error GoTo ERR1
CC = Range(CellRef).Font.Color
CheckColor = CC
GoTo DONE
ERR1:
CheckColor = "#N/A"
DONE:
End Function

.... and then in your =IF function, write something like this:

=IF(CheckColor(CELL("address",A32))=255,"yes it's red","something other than
red")

Hope this gives you some ideas.

HWH


"Paul" wrote in message
...
can I launch or call a macro from an @IF() statement in a
cell? If so, what is the propoer synatax.

Thanks

B. Paul Welch
San Diego



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
macro to call other macros Colin Hayes Excel Worksheet Functions 1 May 3rd 11 05:04 PM
fromula bar sturgeon Excel Discussion (Misc queries) 2 September 25th 07 03:09 PM
Fromula tboy Excel Discussion (Misc queries) 2 May 29th 07 02:17 PM
Call Center Management: How to calculate 'cost per call' Denniso6 Excel Discussion (Misc queries) 2 June 25th 06 05:01 PM
Need a fromula comotoman Excel Discussion (Misc queries) 3 October 3rd 05 05:00 PM


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