Scan in and out time sheet in Excel. Allow six scan in and scan outs in a day. Total the time for the week. Check out my online courses www.easyexcelanswers.com/courses.html
All my courses include online support and a user manual
Let me teach you the VBA that I have learn in my five years of consulting
Let’s take the frustration out of user forms
Become an Affiliate and earn 25% on Course Sales
For more help visit my website www.easyexcelanswers.com or email me at [email protected].
Contact me regarding customizing this template for your needs.
Click for online Excel Consulting
I am able to provide online help on your computer at a reasonable rate.
I use a Blue condenser Microphone to record my videos, here is the link
Check out Crowdcast for creating your webinars
If you need to buy Office 2019 follow
I use Tube Buddy to help promote my videos
Check them out
Follow me on Facebook
TWEET THIS VIDEO
Follow me on twitter
easyexcelanswers
IG @barbhendersonconsulting
You can help and generate a translation to you own language
*this description may contain affiliate links. When you click them, I may receive a small commission at no extra cost to you. I only recommend products and services that I’ve used or have experience with.
code
Sub access()
Dim r As Long
Dim empcode As String
Dim rng, day As Range
Dim grandt As Double
Dim rownumber, col As Long
Dim Total, wktot As Double
Dim gtot As Double
Dim Timein As Date
Dim Timeout As Date
With ActiveSheet
empcode = ActiveSheet.Cells(2, 1)
‘search for today
If empcode = “” Then Exit Sub
If empcode (not equal to) “” Then
col = 3
For col = 3 To 15
If .Cells(1, col).Value = Date Then GoTo findname
Next col
findname:
If empcode (not equal to) “” Then
Set rng = ActiveSheet.Columns(“b:b”).Find(what:=empcode, _
LookIn:=xlValues, lookat:=xlWhole)
rownumber = rng.Row
‘define the row where the total time will be
r = rownumber
‘if the out time is full unhide the next row
Do While rownumber (less than) (rownumber + 5)
.Cells(rownumber, col).Select
If ActiveCell.Offset(0, 1).Value (not equal to ) “” Then
Rows(rownumber + 1).EntireRow.Hidden = False
GoTo down
End If
‘if the in time is empty put the time in there
If ActiveCell.Value = “” Then
ActiveCell.Value = Time
ActiveCell.NumberFormat = “hh:mm”
GoTo ende
End If
‘if in time is full go to out time
If ActiveCell (Not equal to )”” Then
ActiveCell.Offset(0, 1).Select
If ActiveCell.Value = “” Then
ActiveCell.Value = Time
ActiveCell.NumberFormat = “hh:mm”
GoTo caltime
End If
End If
down:
rownumber = rownumber + 1
Loop
End If
End If
caltime:
Timein = CDate(Cells(rownumber, col).Value)
Timeout = CDate(Cells(rownumber, col).Offset(0, 1).Value)
Total = TimeValue(Timeout) – TimeValue(Timein)
Debug.Print Total
Debug.Print Format(Total, “[h]:mm”)
wktot = Cells(rownumber, 17).Value
Cells(rownumber, 17).NumberFormat = “[h]:mm”
Cells(rownumber, 17).Value = Cells(rownumber, 17).Value + Total
Cells(r, 18).NumberFormat = “[h]:mm”
Cells(r, 18).Value = Cells(r, 18).Value + Total
ende:
ActiveSheet.Cells(2, 1).Value = “”
End With
ActiveSheet.Cells(2, 1).Select
End Sub
code for the sheet
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Target.Worksheet.Range(“A2”)) Is Nothing Then
Call access
End If
End Sub