Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement macro
I've been trying to convert an IF statement to something I can run in a
macro with no success. Here is the statement =IF(=MOD(NOW(),1)<=0.270833333333333,"SHIFT: 3RD",IF(=MOD(NOW(),1)<=0.604166666666667,"SHIFT: 1ST",IF(=MOD(NOW(),1)<=0.9375,"SHIFT: 2ND",IF(=MOD(NOW(),1)<=1,"SHIFT: 3RD","")))) It started out as this =IF(T2<=T3,"SHIFT: 3RD",IF(T2<=T4,"SHIFT: 1ST",IF(T2<=T5,"SHIFT: 2ND",IF(T2<=T6,"SHIFT: 3RD","")))) Cell T2 is =MOD(NOW(),1) Cell T3 is 0.270833333333333 Cell T4 is 0.604166666666667 Cell T5 is 0.9375 Cell T6 is 1 I don't want the macro to refer to the cells but the actual formulas/values in the string because I want to delete the cells so that the worksheet isn't updated when opened, only when I run the macro. I would appreciate any help on this code since I am relatively new to macros. TIA |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
IF statement macro
Explain what you have, and what you want to happen. HTH Otto
"Qwerty" wrote in message ... I've been trying to convert an IF statement to something I can run in a macro with no success. Here is the statement =IF(=MOD(NOW(),1)<=0.270833333333333,"SHIFT: 3RD",IF(=MOD(NOW(),1)<=0.604166666666667,"SHIFT: 1ST",IF(=MOD(NOW(),1)<=0.9375,"SHIFT: 2ND",IF(=MOD(NOW(),1)<=1,"SHIFT: 3RD","")))) It started out as this =IF(T2<=T3,"SHIFT: 3RD",IF(T2<=T4,"SHIFT: 1ST",IF(T2<=T5,"SHIFT: 2ND",IF(T2<=T6,"SHIFT: 3RD","")))) Cell T2 is =MOD(NOW(),1) Cell T3 is 0.270833333333333 Cell T4 is 0.604166666666667 Cell T5 is 0.9375 Cell T6 is 1 I don't want the macro to refer to the cells but the actual formulas/values in the string because I want to delete the cells so that the worksheet isn't updated when opened, only when I run the macro. I would appreciate any help on this code since I am relatively new to macros. TIA |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to If Statement | Excel Discussion (Misc queries) | |||
If statement in macro | Excel Discussion (Misc queries) | |||
macro or if statement | Excel Worksheet Functions | |||
If statement in a Macro | Excel Discussion (Misc queries) | |||
Macro and If Statement | Excel Discussion (Misc queries) |