Using Time in Excel

  • Thread starter Thread starter steven plummer
  • Start date Start date
S

steven plummer

I have created a clocking-on style timesheet whereby you enter the time that you start work and time that you finish work and then it calculates how many hours:mins that you have worked and how much overtime has been done. It does work very well but my question is

Is it possible to create a macro that will enter the current time in a particular cell when a button is pressed?

In the spreadsheet that I have created a button like this would elimate human entry error and could end up been a real asset to companies who want to track the time that there employees work.

Thankyou



Submitted via EggHeadCafe - Software Developer Portal of Choice
..NET GDI+ - Convert BitMap To Jpeg
http://www.eggheadcafe.com/tutorial...accd-8291f3c89dfe/net-gdi--convert-bitma.aspx
 
The key combination CTRL-SHIFT-semicolon (or CTRL-colon) inserts the
current time into a cell (followed by <enter>). Similarly, CTRL-
semicolon inserts the date, so if you wanted to insert both the date
and time into a cell you just need to do:

CTRL-semicolon
<space>
CTRL-SHIFT-semicolon
<enter>

Hope this helps.

Pete
 
Pete has given you a manual method which requires no macro.

You can use a macro if you choose but if you have no other use for VBA in
the workbook it may be better to keep the workbook code-free so's users
don't become apprehensive when they get the warning.

Sub NOWTIME()
ActiveCell.Value = Format(Now(), "h:mm:ss AM/PM")
End Sub


Gord Dibben MS Excel MVP
 
Back
Top