Question:
help with ms excel macro?
manekankit
2007-12-26 07:38:58 UTC
is it possible in ms excel that particular macro will run only if some codition is satisfied, i mean say for example if A1=B1, then only the macro should run otherwise the macro should not run, or say if A1=10, then only macro should run. ? is it possible?
Three answers:
expletive_xom
2007-12-26 18:25:38 UTC
jgouldens if statement should work.

you are just missing the name of your macro



-click Tools

-click Macro

-Click Macros



this will give you a list of macros. just put the macro name in where jgoulden wrote macro1.

since you dont need 2 macros, you can just replace it with a zero.
anonymous
2007-12-26 15:43:43 UTC
You do not say what you want the macro to do, so I am wondering if a simple conditional formatting or an IF function will do instead of using a macro.
jgoulden
2007-12-26 15:45:16 UTC
Sure, just use an IF statement:



IF ( A1 = B1 , MACRO_1, MACRO_2 )



MACRO_1 runs if the condition is satisfied; MACRO_2 is invoked if it is not.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...