Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Darran Parsons
 
Posts: n/a
Default Can you perform ctrl+shift+; in a macro to display time?

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.
  #2   Report Post  
Posted to microsoft.public.excel.misc
Norman Jones
 
Posts: n/a
Default Can you perform ctrl+shift+; in a macro to display time?

Hi Darran

Try:

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

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

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



---
Regards,
Norman


"Darran Parsons" <Darran wrote in message
...
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.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run macro based on time Bruce Excel Worksheet Functions 7 December 23rd 05 01:27 PM
Entering Time Macro [email protected] Excel Worksheet Functions 2 September 10th 05 09:09 AM
I cannot get time format to display in a drop-down list Mighty Mike Excel Discussion (Misc queries) 0 February 1st 05 09:47 PM
entering numbers to display a time format Ian Williams/Eazygig Excel Discussion (Misc queries) 1 January 10th 05 11:57 AM
Date and Time Macro m.j.anderson Excel Discussion (Misc queries) 1 December 1st 04 12:35 AM


All times are GMT +1. The time now is 01:25 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"