HELPP!! Simple MACRO help! [Solved/Closed]

Ask a question lsn11 - Latest answer on Jul 26, 2016 08:18PM
I would like to create a macro that will scan sheet one for cells that contain the word "Complete", Copy the whole row, and paste it into another sheet (Sheet 2 - "Complete") without overwriting the rows in sheet 2. And Finally Deleting the copied "Completed" rows from sheet one.
I am having trouble finding a select row by certain text feature to start the macro with.
Text Word "Completed"
Sheet one name - "All PO'S"
Sheet two name - "Completed"
See more 
moins plus
Post some code with the steps you are stuck with. We can help you with broken code! We cannot provide a FREE turn key solution for your business! We are volunteers, and help when you need help!

Record a macro and post it here, start with that!
lsn11- Jul 25, 2016 04:34PM
Hi! I completely understand. This is a macro formula I found in a similar forum I messed around with but does not work.

Sub Macro1()
Dim LR As Long
Range("A2").EntireRow.Insert Shift:=xlDown
LR = Sheets("ALL PO'S").Cells(Rows.Count, "C").End(xlUp).Row
LR1 = Sheets("Completed").Cells(Rows.Count, "A").End(xlUp).Row + 1
With Sheets("Data").Range("C2:C" & LR)
.AutoFilter Field:=1, Criteria1:="ERROR", _
Operator:=xlOr, Criteria2:="MISSING"
.SpecialCells(xlCellTypeVisible).EntireRow.Copy Destination:=Sheets("Errors").Range("A" & LR1)
End With
End Sub
moins plus
Hello Isn11,

The code you have doesn't quite deal with the description you gave in your opening post.

1) You do not appear to be wanting to insert rows. This would not be relevant in your case.

2) The criteria you stated as "Complete" (or is it "Completed"?). The code above has two criteria: "ERROR" and "MISSING" which appear to be irrelevant to your case.

Hence, I would say that the following amended code may be more relevant to your query:-

Sub MoveIt()

  Dim lr As Long

Application.ScreenUpdating = False

With ActiveSheet
    .AutoFilterMode = False
With Range("C1", Range("C" & Rows.Count).End(xlUp))
        .AutoFilter 1, "Completed"
        lr = ActiveSheet.Range("C" & Rows.Count).End(xlUp).Row
        If lr > 1 Then
        .Offset(1).EntireRow.Copy Sheets("Completed").Range("A" & Rows.Count).End(xlUp).Offset(1)
        End If
    End With
    .AutoFilterMode = False
End With

Application.CutCopyMode = False
Application.ScreenUpdating = True

End Sub

The "ActiveSheet" is your main or input sheet ("ALL PO'S") from where the code will be run.

I've assumed that the criteria is in Column C as per the code that you supplied.

See how it works out for you and let us know your thoughts.

moins plus
Hello Isn11,

Sadly, you have cross-posted and not advised anyone that you have done so.

We consider that between this forum and the other in which you have posted, you have enough information to resolve your query by yourself.

Please familiarise yourself with the rules of any forum before signing up.

Hence, this thread will be closed and marked as solved.


Members get more answers than anonymous users.

Being a member gives you detailed monitoring of your requests.

Being a member gives you additional options.

Not a member yet?

sign-up, it takes less than a minute and it's free!