Issue using RemoveDuplicates with Option Base 1

gtche98

New Member
Joined
Aug 15, 2011
Messages
7
There is likely a very simple answer to this question, but I have not found anything in the Excel Help files or in the more popular forums.

I have this piece of code that is part of a much larger routine. Running Excel 2010.

Code:
Range("A1:B1").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.RemoveDuplicates Columns:=Array(1, 2), Header:=xlYes

This code works when it is included in a module with Option Base set to default (0). When I try to run it in a module with option base set to 1, I get the following error: "Run-time Error '5': Invalid Procedure Call or Argument"

I know it has something to do with the Columns:=Array(1,2) used to specify that I want it to look at Columns A and B when identifying the duplicates, but I cannot figure out how to change this statement to make it work with Option Base 1.

Thanks in advance for your help!
Gary
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest
Does anyone have any ideas on this? Should the array be listed as 2,3 in Option Base 1 if it is 1,2 in Option Base 0?

I would appreciate any help I can get on this one...
 
Upvote 0

Forum statistics

Threads
1,224,579
Messages
6,179,656
Members
452,934
Latest member
mm1t1

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