Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Need help building a macro that displays date/time in active cell


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,934
Default Need help building a macro that displays date/time in active cell

Here is a macro to do what you asked for...

Sub InsertDateTime()
ActiveCell.Value = Now
ActiveCell.NumberFormat = "mmm d, yyyy - h:mm:ss AM/PM"
End Sub

Note that unlike the worksheet function NOW(), the date/time entered into
the active cell by this code will be fixed at the date and time the code was
executed.

--
Rick (MVP - Excel)


"MSUser" wrote in message
...


Reply
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
Run a macro in active cell only. Want to place current date/time. time clock watcher Excel Worksheet Functions 3 July 20th 09 07:46 AM
How do I use NOW so that each cell displays a different time? Sheryl[_2_] Excel Worksheet Functions 2 August 30th 08 07:50 PM
FORMAT A CELL TO USE MO/DATE WITH NO YEAR:,DISPLAYS 1900? SKI CLUB BILL Excel Discussion (Misc queries) 2 April 20th 06 04:57 AM
Cell converts a date entry to "=" and displays "01/00/00 ## Excel Worksheet Functions 1 April 8th 05 02:51 PM
Formula window displays correct answer while cell displays incorre MMV Excel Worksheet Functions 3 November 10th 04 09:28 PM


All times are GMT +1. The time now is 08:28 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"