HELPP!! Simple MACRO help!
Solved/Closed
lsn11
-
Jul 25, 2016 at 04:27 PM
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 - Jul 26, 2016 at 08:18 PM
vcoolio Posts 1404 Registration date Thursday July 24, 2014 Status Moderator Last seen September 15, 2023 - Jul 26, 2016 at 08:18 PM
Related:
- HELPP!! Simple MACRO help!
- Spell number in excel without macro - Guide
- Hard disk diagram simple - Guide
- Macro excel download - Download - Spreadsheets
- Simple cash book for pc - Download - Billing and accounting
- Automatically run a macro when opening a worksheet - Guide
3 responses
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!
Record a macro and post it here, start with that!
vcoolio
Posts
1404
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 15, 2023
259
Jul 26, 2016 at 12:27 AM
Jul 26, 2016 at 12:27 AM
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:-
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.
Cheerio,
vcoolio.
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) .Offset(1).EntireRow.Delete End If End With .AutoFilterMode = False End With Application.CutCopyMode = False Application.ScreenUpdating = True Sheets("Completed").Select 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.
Cheerio,
vcoolio.
vcoolio
Posts
1404
Registration date
Thursday July 24, 2014
Status
Moderator
Last seen
September 15, 2023
259
Jul 26, 2016 at 08:18 PM
Jul 26, 2016 at 08:18 PM
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.
Cheerio,
vcoolio.
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.
Cheerio,
vcoolio.
Jul 25, 2016 at 04:34 PM
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
.AutoFilter Field:=1, Criteria1:="ERROR", _
Operator:=xlOr, Criteria2:="MISSING"
.SpecialCells(xlCellTypeVisible).EntireRow.Copy Destination:=Sheets("Errors").Range("A" & LR1)
.SpecialCells(xlCellTypeVisible).EntireRow.Delete
End With
End Sub