LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
scw-tzg
 
Posts: n/a
Default formatting date-time values in macro

Using excel 2003.

Have column with date-time values. I have column formatting: "m/d/yyyy
hh:mm:ss.000". Typical column displays "1/1/3018 00:12:03.930" in the cell
and displays "1/1/3018 12:12:04 AM" in formula bar.

When I try to get the formatted value for the cell in a macro using this
code:
Format(Worksheets("Sheet1").Cells(llCurrentRow, 14).Value, "m/d/yyyy
hh:mm:ss.000") I'm getting "1/1/3018 00:12:04.000" as my result. If I change
my macro code to use format "m/d/yyyy hh:mm:ss.sss" then I get "1/1/3018
00:12:04.044" for my result. But what I really want is the value I see
looking at the spreadsheet cell "1/1/3018 00:12:03.930".

Alternatively, I've tried to copy the cell's formatted value to another
cell, but I haven't figured out how to do that either.

Any help appreciated. TIA.

Susan
 
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
date & time rob Excel Discussion (Misc queries) 1 September 19th 05 10:54 PM
conditional formatting with time values Access Idiot Excel Discussion (Misc queries) 2 September 13th 05 03:29 PM
Calculating Time Values in Excel STELFOXJ Excel Worksheet Functions 0 September 13th 05 02:33 PM
how do I format cells to change date and time to just date bondam Excel Discussion (Misc queries) 3 July 3rd 05 01:10 PM
Date and Time Macro m.j.anderson Excel Discussion (Misc queries) 1 December 1st 04 12:35 AM


All times are GMT +1. The time now is 10:35 PM.

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"