![]() |
Time 24:00:00 in macro
Hi all,
I am trying to copy a cell where time is larger than 24:00:00 in an excel macro, for example, 35:14:45. The original cell is formated as time, and the copy is formatted as general. Whenever I copy and paste by macro, it becomes 35:14:45 - 24:00:00 = 11:14:45. I have already tried the format "hh:mm:ss" in the macro, but it will still subtract 24:00:00 from it. How can I keep the original time shown as 35:14:45 in the copy? Thank you very much. NC |
Time 24:00:00 in macro
[h]:mm:ss
-- David Biddulph "NC" wrote in message ... Hi all, I am trying to copy a cell where time is larger than 24:00:00 in an excel macro, for example, 35:14:45. The original cell is formated as time, and the copy is formatted as general. Whenever I copy and paste by macro, it becomes 35:14:45 - 24:00:00 = 11:14:45. I have already tried the format "hh:mm:ss" in the macro, but it will still subtract 24:00:00 from it. How can I keep the original time shown as 35:14:45 in the copy? Thank you very much. NC |
Time 24:00:00 in macro
As long as the copied cell is formatted [hh]: mm:ss
then Range("A1").Select Selection.Copy Range("B1").Select ActiveSheet.Paste will copy values and formats "NC" wrote: Hi all, I am trying to copy a cell where time is larger than 24:00:00 in an excel macro, for example, 35:14:45. The original cell is formated as time, and the copy is formatted as general. Whenever I copy and paste by macro, it becomes 35:14:45 - 24:00:00 = 11:14:45. I have already tried the format "hh:mm:ss" in the macro, but it will still subtract 24:00:00 from it. How can I keep the original time shown as 35:14:45 in the copy? Thank you very much. NC |
All times are GMT +1. The time now is 06:49 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com