Hi. I have an excel sheet which produces a report on times an employee should start and finish each aspect of their work. I have found though that when I add or subtract certain times I loose the seconds from the final answer
e.g 8:28:53 + 31mins 11secs should come out as 9:00:04. No matter what I do excel returns 9:00:00. I have tried dateadd, cell1 + cell2, working out difference in seconds then adding but it always returns 9:00:00. I need the code to be in VBA and not sheet functions. I have also tried usign the sheet functions to test the calculations and it also returned 9:00:00. When I did a subtract of the times to see what it saysis added I get the result 31:07 - 4 seconds has been lost. Using the same calculation when the answer has minutes in it e.g 9:11:35, the seconds value is also shown. Is this an excel bug or a rounding problem.... this is a test section I added. first line get the difference i want to add in no. of seconds second line then adds it to the actual time which is in a sheet cell temp = DateDiff("s", worktoipsdiff, starttime) temp1 = DateAdd("s", temp , .Range("N" & 10 + dutycount).Value) Am I doing something wrong or is it excel and am I pulling my hair out for no reason Anthony excel 07 --~--~---------~--~----~------------~-------~--~----~ Visit the blog to download Excel tutorials at http://www.excel-macros.blogspot.com To post to this group, send email to excel-macros@googlegroups.com For more options, visit this group at http://groups.google.com/group/excel-macros?hl=en Visit & Join Our Orkut Community at http://www.orkut.com/Community.aspx?cmm=22913620 Visit the blog to download Excel tutorials at http://www.excel-macros.blogspot.com To Learn VBA Macros Please visit http://www.vbamacros.blogspot.com To see the Daily Excel Tips, Go to: http://exceldailytip.blogspot.com -~----------~----~----~----~------~----~------~--~---