View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Pete at Sappi Fine Paper Pete at Sappi Fine Paper is offline
external usenet poster
 
Posts: 23
Default Decimal Places for NOW() in VBA versus formula

Okay, so I enter into cell A1 the formula =NOW(), and set the format to:

m/d/yyyy h:mm:ss.000

.... thus giving me fractions of a second to three decimal places. And those
decimal places display just fine - for example the cell currently reads:

8/21/2006 16:18:15.260

However, when I set the same cell using VBA:

Range("A" & 1) = Now()

I get this:

8/21/2006 16:18:15.000

For some reason it rounds to the nearest second. Any idea why, and how I
can fix it? Thanks!

Pete