ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   IF statement macro (https://www.excelbanter.com/excel-programming/287530-if-statement-macro.html)

Qwerty

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




Otto Moehrbach[_6_]

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







All times are GMT +1. The time now is 02:24 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com