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

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
Hi Darran

Try:

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

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

'<<=============
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top