Run macro from if statement

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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.
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top