LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default VBA Dates & Cell Dates

I have a timesheet spreadsheet that happily calculates hours worked etc, for
a period. Names down the sheet, dates across the sheet.There are several
times and figures for each person, but at the end of the date range I have
some =SUM()'s to add all the hours up,that's fine. But I want to also add
these by department, as deparment size varies and I need to do some other
stuff with the data, I have a macro that works its way down the sheet, adding
up the figures I am interested in. However it doesn't work!
So I have adapted my code to display the figures and running totals
onanother sheet, and I have discovered that when I add 8 hours to 112 hours I
get 96 hours not 120 hours! The cells are formatted [hh]:mm as I am
interested in hours and not days. but when I look at the variable in my code
that holds the cummualtive total and the cell on the spreadsheet that should
have the same value they different!
Cell shows 04/01/1900 16:00:00 and the VBA 03/01/1900 16:00:00.
I've taken this back in 8 hours steps and 24 hours shows as 01/01/1900
00:00:00 in the cell and 31/12/1899 00:00:00 in my VBA. This oddity wouldn't
matter but suddenly when I get to 120 hours they both say the same and I end
up with 96:00 in my cell. There is a similar problem at the transition to 360
hours, (my data doesn't happen to have a transition at 240 hours).

This is obviously a BUG in excel, but any ideas how I should work around it?
I tried looking for the transition, but as the date in the cell isn't the
same as the value in the VBA that didn't work.
 
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
Linking computer dates (time) to spreadsheet dates that have formu bigisle Excel Worksheet Functions 3 January 3rd 10 08:05 PM
how do I sort a column of random dates into Consecutive dates Rob Gibson Excel Worksheet Functions 2 June 12th 07 05:10 AM
Toggle a range of Julian dates to Gregorian Dates and Back PSKelligan Excel Programming 4 May 8th 07 05:51 AM
Charting data against dates where dates are not at fixed intervals PK Charts and Charting in Excel 4 June 16th 05 05:08 AM
the dates on cell format make different dates. date formats morph the dates/chang case New Users to Excel 6 April 18th 05 02:41 AM


All times are GMT +1. The time now is 06:35 AM.

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

About Us

"It's about Microsoft Excel"