Hey guys! Below is a macro I have been working on, but it still does not function quite how I want it to. I have a workbook with sheet1 "Schedule" and sheet2 "Complete". I need for when I put a "99" in column P of the table on the Schedule sheet it will cut and paste the entire row to the last row in the table on the Compete Sheet. Then delete the now blank row on the Schedule sheet. My problem with my code is that it will cut the rows with 99 in column P, but it will paste it on the first blank for AFTER the table on the Complete sheet instead of IN the table. I also can't seem to get it to delete the now blank rows. Please Help!!
Code:
Sub Completecutpaste()
Dim p As Variant
Dim endrow As Integer
Dim Schedule As Worksheet, Complete As Worksheet
Dim lastRow As Long
Set Schedule = ActiveWorkbook.Sheets("Schedule")
Set Complete = ActiveWorkbook.Sheets("Complete")
endrow = Schedule.Range("A" & Schedule.Rows.Count).End(xlUp).Row
lastRow = Complete.Cells(Complete.Rows.Count, "A").End(xlUp).Row '+ 1 for next available row
For p = 2 To endrow
If Schedule.Cells(p, "P").Value = "99" Then
Schedule.Cells(p, "P").EntireRow.Cut Destination:=Complete.Range("A" & Complete.Rows.Count).End(xlUp).Offset(1)
End If
Next
End Sub