Time format

  • Thread starter Thread starter clcnewtoaccess
  • Start date Start date
C

clcnewtoaccess

I have formatted my cells as 12:00:00, but when I do a ctrl+shift+: it always
shows the seconds as 00 (example 10:37:00 should be 10:37:18). I have tried
all of the time formats that look like what I need but nothing works. This
is being done on a HP Jornada pocket PC.
Any Ideas?
 
I've added a macro to my personal.xl* file that steals the ctrl-shift-colon
function and replaces it with what I want.

Saved from a previous post:

If you want to try, create a workbook that includes this code and store it in
your XLStart folder. Lots of people use a workbook named Personal.xls for this
kind of thing.

Option Explicit
Sub Auto_Open()
Application.OnKey "+^:", "'" & ThisWorkbook.Name & "'!Nowtime"
End Sub
Sub Auto_Close()
Application.OnKey "+^:"
End Sub
Sub NowTime()
On Error Resume Next
With Selection
.Value = Now
.NumberFormat = "hh:mm:ss"
End With
If Err.Number <> 0 Then
Beep
Err.Clear
End If
On Error Goto 0
End Sub


If you're new to macros:

Debra Dalgleish has some notes how to implement macros here:
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)
 

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

Similar Threads

Determine if night shift by start & end time 2
autosum not working 1
Formatting cells 5
Formating time 2
Average Time for Specific Item 9
Subtract times? 2
Group Time 3
Formatting Date Field 5

Back
Top