VBAのCollectionの使い方はネットで検索してもすぐには見つからなかった。
なので、VBAの備忘録として記述しておくことにする。
なので、VBAの備忘録として記述しておくことにする。
Dim collection As New collection 'collectionオブジェクト 'コレクションにindexを指定して値を格納する collection.Add "triple", "test" collection.Add "triple2", "test2" 'indexを指定して、コレクションから値を取り出す MsgBox collection.Item("test") 'Collectionの値をfor-eachを使って列挙する 'for-eachの使い方 '構文 For Each variable In collection '説明 variableにcollectionの要素が代入される Dim mytest As String For Each mytest In collection MsgBox mytest Next