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.
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
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