Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel97: Fillup cells with ascending timestamps

Hi,

I have to fillup cells by VBA with hourly timestamps,
formatted as "DD.MM.YYYY HH" in ascending order. I use the
function

dNew = DateAdd("h", 1, dTimeCount)

where dTimeCount is the old timestamp. The cells in the
worksheet are formatted with "TT.M.JJJJ hh".

When the day changes something is wrong:
.....
22.01.2004 21
22.01.2004 22
22.01.2004 23
22.01.2004 00 <---
23.01.2004 01
23.01.2004 02
.....
Instead of 23.01.2004 00<< the cell value is
22.01.2004 00<< !?


Bug or feature ? And how to deal with this ?

Thanks
Holger

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 131
Default Excel97: Fillup cells with ascending timestamps


-----Original Message-----
Hi,

I have to fillup cells by VBA with hourly timestamps,
formatted as "DD.MM.YYYY HH" in ascending order. I use

the
function

dNew = DateAdd("h", 1, dTimeCount)

where dTimeCount is the old timestamp. The cells in the
worksheet are formatted with "TT.M.JJJJ hh".

When the day changes something is wrong:
.....
22.01.2004 21
22.01.2004 22
22.01.2004 23
22.01.2004 00 <---
23.01.2004 01
23.01.2004 02
.....
Instead of 23.01.2004 00<< the cell value is
22.01.2004 00<< !?


Bug or feature ? And how to deal with this ?

Thanks
Holger

.


Can't really say if it would be considered a bug or a
feature (ask someone from MS) - but basically it is
counting midnight, 00:00:00, as part of the day prior. I
suspect this is a rounding error. If it does not
adversely affect any other part of your calculations, try
adding one second (00:00:01) to your timestamps -
then "midnight" will actually show as one second past
midnight, which I would hope Excel could recognize as
being in the following day!
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
Excel calcutions using date/timestamps ghl Excel Discussion (Misc queries) 1 April 14th 10 07:06 PM
Sort ascending requires merged cells to be the same size. Peterbrum Excel Discussion (Misc queries) 2 December 9th 08 05:42 PM
How to decode integer timestamps? Ron West Excel Worksheet Functions 8 November 19th 08 05:51 PM
timestamps in excel Chuck Cusack Excel Discussion (Misc queries) 4 January 24th 06 06:12 AM
Formatting cells in Excel with Ascending/Descending order Andrew Buckley Excel Discussion (Misc queries) 0 November 30th 05 04:41 PM


All times are GMT +1. The time now is 04:18 PM.

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"