Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement in a macro
Hello
New to macro writing so my question is pretty basic... I want the macro to run only if the value of reference cell is less than a certain return. For example, if the return is less than 30% run the macro. If the return is greater than or equal to 30% do not run the macro. How do I go about doing this? The rest of my macro works fine, I just need to limit the range of its use. Any and all help is appreciated. Thanks -- sd |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement in a macro
Hi...
Sub Test() With ThisWorkbook.Sheets("Sheet1") If .Range("B3") < 100 Then Exit Sub 'Your code here MsgBox "Cell B3 is greater than 99" End With End Sub ----- XL2003 Regards William "iamn94" wrote in message ... Hello New to macro writing so my question is pretty basic... I want the macro to run only if the value of reference cell is less than a certain return. For example, if the return is less than 30% run the macro. If the return is greater than or equal to 30% do not run the macro. How do I go about doing this? The rest of my macro works fine, I just need to limit the range of its use. Any and all help is appreciated. Thanks -- sd |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
If Statement to run a macro | Excel Discussion (Misc queries) | |||
how can i use an if statement to run a macro? | Excel Programming | |||
Macro and If Statement | Excel Discussion (Misc queries) | |||
If-statement in Macro | Excel Programming | |||
Macro or IF statement??? HELP! | Excel Programming |