Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Ranges 1

Status
Not open for further replies.

RicksAtWork

Programmer
Nov 1, 2005
120
GB
I have written a function that looks like this:

Function UniqueItemCollection(InputRange As Range) As Collection

'Bunch of code here

End Function

I have named a range Data_Countries

I want to pass this range to my function above..

So I wrote:

UniqueItemCollection(Range("Data_Countries"));

But this throws an error when run 'Object required'

What am I doing wrong?
 

Application.DisplayAlerts = False

You need to set it explicitly back to True when you want to restore normal behavior. (Used to revert automatically with older versions of Excel. -- See the help file.)

BTW, it is better to start a new thread here when you have a new question. (That is the usual protocol.)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top