Hello, I am completely noob at this and reading through these forums. Just learned about VBA and how to create a button for similar need.
I got the following code from another discussion on here. I would like the same date stay in the same row to complete a days worth of punches. and then at the end end add up their hours work for the day deducting the lunch in/out time, if that makes sense?
I would like to make the info unchangeable aside from the timestamp button recording everything to avoid the employees from tampering with their edits.
Is that possible? this is the code I was playing with:
Sub Timestamp()
Dim yourelate As String
Dim LastRow As Object
yourelate = Application.InputBox("Please enter employee ID #", "Employee ID", Type:=1)
Set LastRow = Sheets("Sheet1").Range("A65536").End(xlUp)
With LastRow
.Offset(1, 0) = yourelate
.Offset(1, 2) = yourelate
.Offset(1, 2) = Date
.Offset(1, 3) = Time
End With
End Sub
This is what I left off at and can't figure out how to move forward:
Sub Timestamp()
Dim yourelate As String
Dim LastRow As Object
yourelate = Application.InputBox("Please enter employee ID #", "Employee ID", Type:=1)
ontime = Application.InputBox("Please enter Entry Type", "General", Type:=2)
Set LastRow = Sheets("Sheet1").Range("A65536").End(xlUp)
With LastRow
.Offset(1, 0) = yourelate
.Offset(1, 1) = ontime
.Offset(1, 2) = Date
.Offset(1, 3) = Time
End With
End Sub
I'm really new to all this and just staring at the codes and adding and editing information until it functions in how I'm envisioning through trial and error. I'm not well versed in the lingo but a quick study and google anything I don't know but figured asking will be faster.
I appreciate any help.
Thank you!
I got the following code from another discussion on here. I would like the same date stay in the same row to complete a days worth of punches. and then at the end end add up their hours work for the day deducting the lunch in/out time, if that makes sense?
I would like to make the info unchangeable aside from the timestamp button recording everything to avoid the employees from tampering with their edits.
Is that possible? this is the code I was playing with:
Sub Timestamp()
Dim yourelate As String
Dim LastRow As Object
yourelate = Application.InputBox("Please enter employee ID #", "Employee ID", Type:=1)
Set LastRow = Sheets("Sheet1").Range("A65536").End(xlUp)
With LastRow
.Offset(1, 0) = yourelate
.Offset(1, 2) = yourelate
.Offset(1, 2) = Date
.Offset(1, 3) = Time
End With
End Sub
This is what I left off at and can't figure out how to move forward:
Sub Timestamp()
Dim yourelate As String
Dim LastRow As Object
yourelate = Application.InputBox("Please enter employee ID #", "Employee ID", Type:=1)
ontime = Application.InputBox("Please enter Entry Type", "General", Type:=2)
Set LastRow = Sheets("Sheet1").Range("A65536").End(xlUp)
With LastRow
.Offset(1, 0) = yourelate
.Offset(1, 1) = ontime
.Offset(1, 2) = Date
.Offset(1, 3) = Time
End With
End Sub
I'm really new to all this and just staring at the codes and adding and editing information until it functions in how I'm envisioning through trial and error. I'm not well versed in the lingo but a quick study and google anything I don't know but figured asking will be faster.
I appreciate any help.
Thank you!