Delete Duplicate Rows Runtime Error Invalid Procedure Call or Argument

NorthbyNorthwest

Board Regular
Joined
Oct 27, 2013
Messages
147
Office Version
  1. 365
Hi, hope someone can help me. I have a very large data set which includes duplicate rows. I need to delete these rows. Normally, I delete based on a column. However, in this case I want to delete the row based on every column containing duplicate information. I tried code below and got runtime error 5, invalid procedure call or argument. Is my data set too large? Or is there something wrong with procedure? How can achieve my goal? Thanks.

Code:
[SIZE=3][COLOR=#000000][FONT=Calibri]Sub RemoveDupRows()<o:p></o:p>[/FONT][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][FONT=Calibri]   Sheets("output").Range("$A$1:$A$662592").RemoveDuplicatesColumns:=Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), Header:=xlNo<o:p></o:p>[/FONT][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][FONT=Calibri]End Sub
<o:p></o:p>[/FONT][/COLOR][/SIZE]
 
Last edited by a moderator:

Excel Facts

Round to nearest half hour?
Use =MROUND(A2,"0:30") to round to nearest half hour. Use =CEILING(A2,"0:30") to round to next half hour.
Hi, hope someone can help me. I have a very large data set which includes duplicate rows. I need to delete these rows. Normally, I delete based on a column. However, in this case I want to delete the row based on every column containing duplicate information. I tried code below and got runtime error 5, invalid procedure call or argument. Is my data set too large? Or is there something wrong with procedure? How can achieve my goal? Thanks.

Code:
[SIZE=3][COLOR=#000000][FONT=Calibri]Sub RemoveDupRows()<o:p></o:p>[/FONT][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][FONT=Calibri]   Sheets("output").Range("$A$1:$A$662592").[/FONT][/COLOR][COLOR=#ff0000][FONT=Calibri][B]RemoveDuplicatesColumns[/B][/FONT][/COLOR][COLOR=#000000][FONT=Calibri]:=Array(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15), Header:=xlNo<o:p></o:p>[/FONT][/COLOR][/SIZE]
[SIZE=3][COLOR=#000000][FONT=Calibri]End Sub[/FONT][/COLOR][/SIZE]
<o:p></o:p>
Assuming the part I highlighted in red is a typo in your post, your range does not cover 15 columns. Should that range be:
Range("$A$1:$O$662592") ??????
 
Upvote 0
Solution
Thanks, for the second pair of eyes. Sometimes we (me in this instance) overlook the obvious! Again, many thanks.
 
Upvote 0

Forum statistics

Threads
1,203,755
Messages
6,057,158
Members
444,908
Latest member
Jayrey

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