Need help building a macro that displays date/time in active cell
|
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 ... |
All times are GMT +1. The time now is 11:39 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com