Can you call a macro as in an IF statement

K

kls

As the subject implies, I want to know if I can call a macro as a result
of true logic in an IF statement. If not, how do you go about calling a
macro as a result of conditional statements?

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 
D

Don Guillett

A macro can only be called with a macro
sub gg()
if range("a1")=1 then call mymacro
end sub
 
T

Tom Ogilvy

in VBA

If condition then
mymacro
End if

in A worksheet cell, create a userdefined function

=if(condition,Trigger(),"")

Public Function Trigger()
Trigger = "ABCD"
End Function

however, Trigger can only return a value. It can not change other aspects of
the worksheet.

If you need to do things like that, use the calculate or the change event.
 
Top