Trying to Record Macro and getting the pop-up "Too many line continuations"

PaigeWarner

New Member
Joined
May 27, 2020
Messages
48
Office Version
  1. 365
Platform
  1. MacOS
Hello,

I am trying to do a Record Macro and filter out and Delete all lines that start with 51 in column D Purchasing Document. When I have my filter on and put 51* in the search field in column D, I get this pop-up message which then also stops the recording:

1616010705901.png



Here is what the code looks like in Visual Basic after auto stopping:
__________________________________________________________________________________
Sub PO_51_DELETE()
'
' PO_51_DELETE Macro
'

'
Rows("1:1").Select
Selection.AutoFilter
ActiveSheet.Range("$A$1:$D$1329").AutoFilter Field := 4, Criteria1 := Array( _
"5100058294","5100217898","5105518931","5106444516","5106457849","5107405499", _
"5107583231","5107839718","5107897397","5107897399","5107934878","5107956289", _
"5108006056","5108010504","5108024465","5108048923","5108057848","5108057859", _
"5108057894","5108057895","5108057896","5108059075","5108065997","5108065998", _
"5108073276","5108073277","5108073278","5108073279","5108073280","5108073281", _
"5108073282","5108073283","5108073917","5108073918","5108073921","5108073940", _
"5108073941","5108073942","5108073958","5108073959","5108073960","5108073961", _
"5108073962","5108073963","5108073964","5108073965","5108073975","5108079163", _
"5108079165","5108079194","5108079198","5108079199","5108083441","5108083487", _
"5108083488","5108083489","5108083490","5108083491","5108092894","5108097166", _
"5108101387","5108101388","5108101389","5108101390","5108101391","5108101392", _
"5108101393","5108101417","5108102937","5108102942","5108102981","5108102986", _
"5108102987","5108102988","5108102989","5108102993","5108105785","5108106489", _
"5108107777","5108108399","5108109289","5108113645","5108113654","5108113666", _
"5108113668","5108113669","5108113670","5108118560","5108118571","5108119561", _
"5108119580","5108119581","5108119586","5108119587","5108119588","5108119589", _
"5108119592","5108119597","5108120128","5108120138","5108122281","5108122282", _
"5108122685","5108122698","5108123888","5108124882","5108124892","5108124897", _
"5108126034","5108126071","5108127455","5108127981","5108128562","5108129362", _
"5108129399","5108130076","5108130077","5108130600","5108132341","5108132362", _
"5108132363","5108132998","5108135389","5108135446","5108135450","5108136047", _
"5108136049","5108136052","5108136073","5108136086","5108136812","5108139197", _
"5108139198","5108139629","5108140964","5108141035","5108141036","5108141053", _
End Sub
__________________________________________________________________________________



Here is a copy and paste of the columns in the sheet for reference:
IDoc numberPartner numberVendor NamePO Number
79988937511121GHI Incorporated4700491539
79988937111121GHI Incorporated4700583480
79988857211121GHI Incorporated4700651978
79988937711121GHI Incorporated4703011097
79992539531415JKL Incorporated4703319968
79992275831415JKL Incorporated4703481592
79967931531415JKL Incorporated4703539860
79975258931415JKL Incorporated4703539861
79992539931415JKL Incorporated4703612696
79964883216171MNO Incorporated4703619064
79964883216171MNO Incorporated4703619065
79964883216171MNO Incorporated4703619066
79964883216171MNO Incorporated4703619068
79964883216171MNO Incorporated4703619069
80001892867891DEF Incorporated4703619070
80001892867891DEF Incorporated4703619071
79964883216171MNO Incorporated4703619073
79964883216171MNO Incorporated4703619075
79964883216171MNO Incorporated4703619078
80001892867891DEF Incorporated4703619079
80001892867891DEF Incorporated4703619080
79964883216171MNO Incorporated4703619086
79964883216171MNO Incorporated4703619087
79964883216171MNO Incorporated4703619089
80001892867891DEF Incorporated4703619090
80001892867891DEF Incorporated4703619094
79964883216171MNO Incorporated4703619096
79964883216171MNO Incorporated4703637552
79964883216171MNO Incorporated4703699082
80001892867891DEF Incorporated4703699152
80001892867891DEF Incorporated4703699153
79964883216171MNO Incorporated4703729793
79964883216171MNO Incorporated4703761017
79964883216171MNO Incorporated4703771594
80001892867891DEF Incorporated4703827161
80001892867891DEF Incorporated4703830356
79988937511121GHI Incorporated4703843760
79988937111121GHI Incorporated4703857279
79988857211121GHI Incorporated4703857280
79988937711121GHI Incorporated4703869272
79992539531415JKL Incorporated4703869273
79992275831415JKL Incorporated4703875852
79967931531415JKL Incorporated4703877151
79975258931415JKL Incorporated4703883842
 

Attachments

  • 1616008907771.png
    1616008907771.png
    26.2 KB · Views: 11

Excel Facts

Did you know Excel offers Filter by Selection?
Add the AutoFilter icon to the Quick Access Toolbar. Select a cell containing Apple, click AutoFilter, and you will get all rows with Apple
Try doing it like
VBA Code:
Range("A1:D1").AutoFilter 4, ">=5100000000", xlAnd, "<5200000000"
 
Upvote 0
That suggests they are text & not numbers, in which case try
VBA Code:
Range("A1:D1").AutoFilter 4, "51*"
 
Upvote 0
Thank you for your help but unfortunately I can't get that new one to work either. Appreciate the attempt!
 
Upvote 0
In what way didn't it work?
 
Upvote 0
Woops, nevermind- it does half work. It filters by the 51s but the part that I don't see happening is those rows getting deleted. It needs to be able to also delete any row that has a PO starting with 51 in column 4.
 
Upvote 0
You haven't posted any code for deleting those rows.
 
Upvote 0
Yes, I don't know how to create code that can do what I wanted. That is why I am here asking for help. The only part of the code I had was the first part from doing a record macro, but I did put in my original post that I needed the code to also delete the lines (rows).
 
Upvote 0
Whilst you said
I am trying to do a Record Macro and filter out and Delete all lines
You only posted the part of the recorded macro that handled the filter, not the part that deleted the rows.
 
Upvote 0

Forum statistics

Threads
1,214,948
Messages
6,122,420
Members
449,083
Latest member
Ava19

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top