私はコレクションのコレクションを持っています。内側のコレクションは文字列アイテムを保持します。インナーコレクションを充填ループのコレクションのコレクション
:
アウターコレクション充填Function collect_excellent_Companies(ByVal folderName As String, ByVal fileName As String) As Collection
..
Do While .Cells(countGreens, 1).Interior.Color = 65280
myCol.Add CStr(.Cells(countGreens, 4).Value2)
countGreens = countGreens + 1
Loop
...
End Function
:
For iRow = 1 To LastRow
param1 = .Cells(iRow, 1).Value2 + "-Info"
param2 = .Cells(iRow, 1).Value2
fullCollection.Add collect_excellent_Companies(param1, param2)
Next iRow
を今、私は
Dim sepCol As Collection
Set sepCol = New Collection
Dim tmpCol As Collection
Set tmpCol = New Collection
Dim myStr As Object
'Loop over each competion
For Each sepCol In myCol
For Each myStr In sepCol
tmpCol.Add myStr
Next myStr
next sepCol
と、外側と内側のコレクションをループにしたい私がチェックしていますこのループの前のコレクションの内容はすべてOKです。私が手にエラーが行である:
For each myStr in sepCol
Runtime Error 424: Object necessary.
私はすでにD im myStr as Object
にDim myStr as String
を変えたが、これは役立ちません。私がこの仕事をした人はどんな考えでも大歓迎です!
を設定しなければならなかった、あなたは論理的である私のコレクション、各コレクションのために言っているが、それは今まで何、それはアイテムです。 –