Run macro from if statement

S

Steve

Is there a way to run a macro from the results of an if statement? i.e. if(cell a2=1,"run macro",dont run
Any ideas? What I am trying to do ultimately is show a userform if the contents of a cell are changed
Thanks
 
C

charles osborne

I can't find a way to run a macro, but where is your
userform that you want to show? It is possible to call
another worksheet or area in the formula. If your userform
isn't on an Excel worksheet you could paste it into one.
-----Original Message-----
Is there a way to run a macro from the results of an if
statement? i.e. if(cell a2=1,"run macro",dont run)
Any ideas? What I am trying to do ultimately is show a
userform if the contents of a cell are changed.
 
E

Earl Kiosterud

Charles,

You can't run a macro from an IF statement. It would violate the order of
the universe, and we'd all end up ... never mind.

You need to make a Worksheet_Change macro. It lives in the sheet module,
not a regular module. There's a reply I just did to a Joe Firefighter about
that. Check it out.
--
Earl Kiosterud
mvpearl omitthisword at verizon period net
-------------------------------------------

Steve said:
Is there a way to run a macro from the results of an if statement? i.e.
if(cell a2=1,"run macro",dont run)
Any ideas? What I am trying to do ultimately is show a userform if the
contents of a cell are changed.
 
Top