That's NOT what you first said.
You said you wanted an EVENT to run ONLY after 10:00am.

Now, if you use:
=TODAY()+0.41667
Then, it will always show "today"'s date and 10:00am
(you have to format it as custom format: 
m/d/yyyy hh:mm:ss AM/PM

but that means that if you open the file 
any time after midnight tonight, it'll read:

10/21/2009 10:00 AM

Now, if you use:

=IF(HOUR(NOW())>=10,TODAY()+0.41667,TODAY()-1+0.41667 )
it will show YESTERDAY at 10:00 am until
10:00:01, then it will show TODAY at 10:00am.

The problem with that is that if it's Monday morning,
it will show Yesterday (Sunday)

To fix this, you could use:
IF(WEEKDAY(TODAY()) = 2,TODAY()-3,TODAY()-1)
this will test yesterday (today()-1) to see if it is a 
monday (weekday = 2) if it is, then use today-3

your formula would then look like:

=IF(HOUR(NOW())>=10,TODAY()+0.41667,IF(WEEKDAY(TODAY()-1)<2,TODAY()-3,TODAY()-1)+0.41667
 )

This at least will show you the previous workday
until 10:00am, after that, it will show TODAY.

This will update whenever you open the file.
Regardless if any changes are made.

Now.. if you ONLY want this to update if the file is CHANGED...
for instance, you open the file to view it, the last time it was
CHANGED was last Wednesday, so it shows last Wednesday's date.
But you don't want this date to change unless you make
changes to the file.

In this case, I would recommend creating a Worksheet_Change event
that updates this cell.  That way, it continues to show
the previously saved date, until a change is made.

If this is what you want to do, let us know and we can help.

paul


________________________________
From: Praveen Khunte <praveen.khu...@gmail.com>
To: excel-macros@googlegroups.com
Sent: Tuesday, October 20, 2009 12:22:28 PM
Subject: $$Excel-Macros$$ Re: Displaying fixed time everyday

Hi Dilip
Thanks for the effort.It gave me sound idea of manipulating date.
However, I would like to reiterate the problem.
The cell displays 10/20/2009 10:00AM on 20th October.
Can I display 10/21/2009 10:00AM on the same cell automatically when I open the 
file to 21st October.
This means that dynamic date but fixed time in single cell. I hope you 
understand my requirement.

Thanks
Best Regards
Praveen Khunte

Dilip Pandey wrote: 
Hi Praveen,
>
>Try below formula:-
>=IF(AND(HOUR(NOW())>=10,MINUTE(NOW())>=0, SECOND(NOW())>0),TODAY()+1,TODAY())
>Best Regards,
>-- 
>DILIP KUMAR PANDEY  
>  MBA-HR,B COM(Hons.),BCA
>Mobile: +91 9810929744
>dilipan...@gmail.com
>dilipan...@yahoo.com
>New Delhi - 110062
>
>
>
>On Tue, Oct 20, 2009 at 7:18 AM, Praveen Khunte <praveen.khu...@gmail.com> 
>wrote:
>
>
>>Hi ALL
>>In a excel sheet, I want to trigger an event everyday when time exceeds
>>10 AM.
>>Is it possible to display on 20th October 2009 in a cell 20-Oct-2009
>>10:00 AM,
>>and when date changes to 21st October 2009 then it should automatically
>>change to 21-Oct-2009 10:00 AM
>>
>>Thanks in advance
>>Regards
>>Praveen
>>
>>>
>>
>>
>>
>>
>>

--~--~---------~--~----~------------~-------~--~----~
----------------------------------------------------------------------------------
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com
<><><><><><><><><><><><><><><><><><><><><><>
HELP US GROW !!

We reach over 6,500 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~----------~----~----~----~------~----~------~--~---

Reply via email to