New version - some other mods need making which I've just spotted.
Sub PunchIn()
Rows("3:3").Insert Shift:=xlDown
Cells(3, 1) = GetUserName()
Cells(3, 2) = Date
Cells(3, 3) = Time
Cells(3, 4) = "-"
'ActiveWorkbook.Save
'ActiveWorkbook.Close
End Sub
Sub PunchOut()
User = Trim(GetUserName())
User = Left(User, Len(User) - 1)
For N = 3 To Cells(65536, 1).End(xlUp).Row
If Cells(N, 1) = User Then Exit For
Next N
Cells(N, 5) = Time
Cells(N, 6) = "="
Cells(N, 7) = Cells(N, 5) - Cells(N, 3)
'ActiveWorkbook.Save
'ActiveWorkbook.Close
End Sub
Bookmarks