ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inserting the system time (https://www.excelbanter.com/excel-programming/298625-inserting-system-time.html)

Dazza

Inserting the system time
 
Hi, I have a command button that executes a VB marco (it
refreshed price data). What code can I use so that the
time that the macro was executed, in format hh.mm.ss, is
displayed in cell P12?

Kind Regards,

mudraker[_223_]

Inserting the system time
 
format p12 to the way you require it to display the time

use this code
range("p12")=now()


---
Message posted from http://www.ExcelForum.com/


Olly[_6_]

Inserting the system time
 
Range("P12").Value=Format(Now(),"hh.mm.ss")

--
Olly


"Dazza" wrote in message
...
Hi, I have a command button that executes a VB marco (it
refreshed price data). What code can I use so that the
time that the macro was executed, in format hh.mm.ss, is
displayed in cell P12?

Kind Regards,





All times are GMT +1. The time now is 09:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com