Time > 24:00:00 in macro

G

Guest

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top