Hi d
Thanks for posting your ArrayList class. However, I'm not the brightest light bulb in
the room so I am going to need some _basic_ help. OK?
(a) I created a new Excel(2007) macro WB.
(b) Added a module (relax) and put in a stub Sub with a string variable that said
See Spot Run
(c) Went to your site.
(d) Added a Class Module
(e) Copied the code (all of it) into the Class Module
(f) I got VBA errors on the lines below
'VERSION 1.0 CLASS
'BEGIN
' MultiUse = -1 'True
'End
'Attribute VB_Name = "ArrayList"
'Attribute VB_GlobalNameSpace = False
'Attribute VB_Creatable = False
'Attribute VB_PredeclaredId = False
'Attribute VB_Exposed = False
My questions are:
1 - Am I supposed to comment out the lines above?
2 - Am I supposed to put them someplace else?
I apologize in advance for these basic questions - but I had to ask.
EDIT
On compile
User defined type not defined
Public Function GetDistinctValues() As ArrayList
Please Note
=================
Commented out all the Attributes as described above
I changed the Class Module from Class1 to MyArrayList
Changed Instancing from Private to PublicNotCreateable (and back again)
-- SO -- I am not certain if __I__ have introduced these errors.
'Attribute VB_Name = "ArrayList"
NEW EDIT
Ok - after reading a thingie by Chip Pearson I understand now.
http://www.cpearson.com/excel/DefaultMember.aspx
Note:
I just took your code to a TEXT file and imported it in.
(1) You have to copy your code into a TEXT file.
(2) Import the TEXT file into the WB.
Below is some code I tried just as a quick catch-up.
I am not grasping HOW TO USE the .arrayCopy method
and would need help.
EDIT - New Post - Updated Sub Main
(1) Added a Range to ArrayList
(2) Added a Variant that contained a Range to ArrayList
Bother (1) and (2) were ACCEPTED but it created errors
in
.Contains
.GetDistinctValues
Trapping Objects
Recall I added a range to your ArrayList Class
but it broke the Contains Method
Perhaps it is NOT the intention of the class to accept
a range object - OTOH - if it is OK - maybe a 8204
check against each element might be required?
New Edit
This Worked (adding to code above)
regards
John
Bookmarks