Looping


Display the Keys

You can loop through using the index position.

Dim icount As Integer 
For icount = 0 To oDict.Count - 1
   Debug.Print oDict.Keys(icount)
   Debug.Print oDict.Keys()(icount) 'not recommended
Next icount

Display the Values

You can loop through using the index position.

Dim icount As Integer 
For icount = 0 To oDict.Count - 1
   Debug.Print oDict.Items(icount)
   Debug.Print oDict.Items()(icount) 'not recommended
Next icount

Display the Values

You can loop through using the unique keys.

Dim vKey As Variant 
For Each vKey in oDict.Keys
   Debug.Print oDict.Item(vKey)
Next vItem

© 2025 Better Solutions Limited. All Rights Reserved. © 2025 Better Solutions Limited TopPrevNext