View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default VBA time and date?

Maybe this

Sub Button1_Click()
Range("A1").Value = Now
End Sub

Mike

"Steve" wrote:

On selecting a commandbutton I need to automatically insert the time and
date into a cell. I know that NOW() would do that but how do i get the time
and date in VBA?

thx

Steve


---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 080115-0, 15/01/2008
Tested on: 16/01/2008 09:27:14
avast! - copyright (c) 1988-2008 ALWIL Software.
http://www.avast.com