Can you perform ctrl+shift+; in a macro to display time?

D

Darran Parsons

I would like to add current but static time to a cell within a larger macro,
but the only way I can find to enter just the time and not date as well is to
use ctrl+shift+; but it doesn't appear that macro allow the use of hardkeys,
although my knowledge of macros is basic i'm sure there must be a work around.
 
N

Norman Jones

Hi Darran

Try:

'=============>>
Public Sub TesterC()

With Range("A1")
.Value = Time
.NumberFormat = "h:mm AM/PM"
End With
End Sub

'<<=============
 
Top