Create a timecard that can calculate time on a 12 hour format?

G

Guest

I am needing help creating and worksheet that I can calculate hours worked
from a time clock, on a 12 hour format. Thank you!
 
M

Mark

Hi,

http://www.geocities.com/geo_marksway/excel_solutions/XLS/C
lockWork.xls

Here is the code:

'Clock On, Clock Off. A time difference that tells you how
long you have _
worked. Suitable for only current Day.

Sub ClockOn()
Range("A5").Select
ActiveCell.FormulaR1C1 = "=now()"
Selection.NumberFormat = "h:mm AM/PM"
Range("A5").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues ',
Operation:=xlNone, SkipBlanks _
' :=False, Transpose:=False
Application.CutCopyMode = False
End Sub

Sub ClockOff()
Range("B5").Select
ActiveCell.FormulaR1C1 = "=now()"
Selection.NumberFormat = "h:mm AM/PM"
Range("B5").Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues ',
Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("C5").Select
ActiveCell.FormulaR1C1 = "=RC[-1]-RC[-2]"
Selection.NumberFormat = "hh ""Hours"" :mm ""Minutes"" "
End Sub


regards
Mark
 

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

Top