I'm struggling to make the code I have work for the below. For anything in column J that returns "Yes", I want the entire row to to be copied and pasted in another sheet starting at row 4 on the new sheet. After executing, I want the original row on the original sheet to then be deleted and for the code to the continuously execute until the data in cell A is empty.
This is what I have so far. I run into an issue with the line VLV.Cells(Rows.Count, "J").End (xlUp) + 4 = ActiveCell.Row (I know this line is completely wrong but I'm not sure how to fix)
ub VPLTest()
Application.ScreenUpdating = False
Activesheet.Unprotect Password:="purc"
Dim VLV As Worksheet
Dim PCF As Worksheet
Set VLV = Activesheet
Sheets.Add after:=Activesheet
Activesheet.Name = "PCF Items"
Set PCF = Activesheet
VLV.Range("A1:N4").Copy PCF.Range("A1:N4")
VLV.Select
VLV.Range("J5").Select
Do Until ActiveCell = ""
If ActiveCell.Value = "Yes" Then
VLV.Cells(Rows.Count, "J").End (xlUp) + 4 = ActiveCell.Row
End If
If ActiveCell = "Yes" Then EntireRow.Delete
Loop
This is what I have so far. I run into an issue with the line VLV.Cells(Rows.Count, "J").End (xlUp) + 4 = ActiveCell.Row (I know this line is completely wrong but I'm not sure how to fix)
ub VPLTest()
Application.ScreenUpdating = False
Activesheet.Unprotect Password:="purc"
Dim VLV As Worksheet
Dim PCF As Worksheet
Set VLV = Activesheet
Sheets.Add after:=Activesheet
Activesheet.Name = "PCF Items"
Set PCF = Activesheet
VLV.Range("A1:N4").Copy PCF.Range("A1:N4")
VLV.Select
VLV.Range("J5").Select
Do Until ActiveCell = ""
If ActiveCell.Value = "Yes" Then
VLV.Cells(Rows.Count, "J").End (xlUp) + 4 = ActiveCell.Row
End If
If ActiveCell = "Yes" Then EntireRow.Delete
Loop