Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 201
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to If Statement JHusker Excel Discussion (Misc queries) 7 October 10th 08 10:39 PM
If statement in macro orquidea Excel Discussion (Misc queries) 2 May 11th 08 08:19 PM
macro or if statement CHARI Excel Worksheet Functions 2 December 8th 06 08:56 PM
If statement in a Macro Dave Excel Discussion (Misc queries) 1 January 29th 05 12:17 AM
Macro and If Statement SATB Excel Discussion (Misc queries) 2 December 3rd 04 04:46 PM


All times are GMT +1. The time now is 10:17 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"