i keep getting errors when im trying to run this bit of code
Private Sub signout_Click()
Dim ws, ws2, ws3, ws4 As Worksheet
Dim iRow, iRow2, iRow3 As Long
Dim myRng2 As Range
Dim staffin, staffout As String
Set ws = Workbooks("payslips").Worksheets("Employee Details")
Set ws2 = Workbooks("payslips").Worksheets("Sign In-Out")
Set ws3 = Workbooks("payslips").Worksheets("Weekly")
Set ws4 = Workbooks("payslips").Worksheets("Record of all Sign In-Out")
iRow = Cells.Find(what:=Me.staffout, After:=ws2.Range("B2"), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Row
ws2.Cells(iRow, 5).Value = Time
iRow2 = Cells.Find(what:=ws2.Cells(iRow, 1).Value, After:=ws3.Range("A2"), LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Row
ws3.Cells(iRow2, 5).Value = ws3.Cells(iRow2, 5).Value + ws2.Cells(iRow, 6).Value
'finds first empty row in database
iRow3 = ws4.Cells(Rows.Count, 1) _
.End(xlUp).Offset(1, 0).Row
' the current error is iRow3 is an invalid qualifier on the below line
ws2.Range(iRow.Row).Cut Destination:=ws4.Range(iRow3.Row)
End Sub
I'm not even sure if this is the best way to do it. Any tips or ideas would be greatly appreciated
Regards Mag
Bookmarks