trying to create a time sheet with clickable buttons

T

tarabull

i want a clock in, lunch out, lunch in, and clock out button that will
automatically enter current date and time in a new row each day - it seems
like something that would already be templated, but i have searched the web
high and dry and have found nothing (well at least free!!)

Can anyone please help?
 
G

Gary''s Student

In A1 thru D1 enter:

Clock In Lunch Out Lunch In Clock Out

then enter this event macro in the worksheet code area:

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
Set r = Range("A:D")
Set t = Target
If Intersect(t, r) Is Nothing Then Exit Sub
If t.Value <> "" Then Exit Sub
Cancel = True
t.Value = Now
End Sub

Now a double-click in a cell in columns A thru D will result in the
date/time being entered in the cell.
 

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