Re: Inserting current time

Giganews Newsgroups
Subject: Re: Inserting current time
Posted by:  J.E. McGimpsey (jemcgimps…
Date: Mon, 13 Oct 2003

CTRL-Shift-: will only insert minutes. If you want it to insert
seconds, the way I do it is to put these in a workbook in your
XLStart folder (e.g., Personal.xls),:

in the ThisWorkbook module:

    Private Sub Workbook_Open()
        Application.OnKey "+^:", "CtrlShiftColon"
    End Sub

and in a regular code module:

    Public Sub CtrlShiftColon()
        With Selection
            .NumberFormat = "hh:mm:ss"
            .Value = Time
        End With
    End Sub

In article <028001c391af$34dcdd60$a40128…@phx.gbl>,
"Talltone" <curete…> wrote:

> I am trying to insert times into a Excel 2000 spreadsheet
> in the format hh:mm:ss.  Because a number of events have
> to be logged, some very close together, I am trying to use
> the CTRL + SHIFT + : (colon) technique.  I have formatted
> the cells to show hh:mm:ss but when I use the key
> combination above, it only gives me hh:mm.  When I press
> RETURN to move to the next cell the cell data then changes
> to hh:mm:00.
> In other words I cannot get it to record the seconds.
> Please can somebody help! I seem to be close to the
> solution but not close enough!  The computer clock shows
> seconds, by the way.


In response to

Inserting current time posted by Talltone on Mon, 13 Oct 2003