You can avoid the bug described by @CristianBuse by using a Scripting.Dictionary and using the .items or .Keys. Methods to return arrays that can be iterated over using for each.
In answer to you question the wrapping of a collection or scripting dictioanry is good practise as it allows you to have strong typing for the host collection. You can also use the wrapping code to add validation to your input values or to extend the functionality of the host collection
The code below shows the wrapping of a scripting dictionary, validation on the add method and an extension that simplifies adding data to the scripting dictionary. These are just examples to demonstrate a point
Option Explicit
Private Type State
Host As scripting.Dictionary
End Type
Private s As State
Private Sub Class_Initialize()
Set s.Host = New scripting.Dictionary
End Sub
Public Property Get Item(ByVal ipKey As Long) As String
Item = s.Host.Item(ipKey)
End Property
Public Property Let Item(ByVal ipValue As String, ByVal ipKey As Long)
s.Host.Item(ipKey) = ipValue
End Property
Public Sub Add(ByVal ipKey As Long, ByVal ipValue As String)
If ipKey > 10 Then
Err.Raise _
5 + vbObjectError, _
"Size Error", _
"Object based on Class " & TypeName(Me) & " is limited to 0-9 members"
End
End If
s.Host.Add ipKey, ipValue
End Sub
Public Sub AddByIndex(ByVal ipArray As Variant)
Dim myArray As Variant
If Not IsArray(ipArray) Then
myArray = Array(ipArray)
Else
myArray = ipArray
End If
Dim myNextKey As Long
myNextKey = s.Host.keys(s.Host.Count - 1)
Do While s.Host.Exists(myNextKey)
myNextKey = myNextKey + 1
Loop
Dim myItem As Variant
For Each myItem In myArray
s.Host.Add myNextKey, myItem
myNextKey = myNextKey + 1
Next
End Sub
Public Function Items() As Variant
Items = s.Host.Items
End Function
So you can now do
oclass.addbyindex Range("A1:A42").value
and
Dim myItem as Variant
For Each myItem in oClass.Items