Sub M_snb()
With CreateObject("scripting.dictionary")
.CompareMode = 0
.Add "L_" & .Count, "A B C D E"
For Each it In Array("X", "Y", "Z", "x", "y", "z")
.Item(it) = it
Next
MsgBox Join(.keys, vbLf)
End With
With CreateObject("scripting.dictionary")
.CompareMode = 1
.Add "L_" & .Count, "A B C D E"
For Each it In Split("X Y Z x y z")
.Item(it) = it
Next
MsgBox Join(.keys, vbLf)
End With
With CreateObject("scripting.dictionary")
.CompareMode = 1
.Add "L_" & .Count, "A B C D E"
For Each it In Split("X Y Z x y z")
.Item(it) = it
Next
MsgBox Join(.keys, vbLf)
End With
With CreateObject("scripting.dictionary")
.CompareMode = 1
.Add "L_" & .Count, "A B C D E a b c d e"
For Each it In Split(.Item("L_0"))
.Item(it) = it
Next
MsgBox Join(.keys, vbLf)
End With
With CreateObject("scripting.dictionary")
.CompareMode = 0
.Add "L_" & .Count, "ABCDEabcde"
For Each it In Split(Format(.Item("L_0"), Replace(Space(Len(.Item("L_0"))), " ", "@ ")))
.Item(it) = it
Next
MsgBox Join(.keys, vbLf)
End With
End Sub
More on dictionaries: http://www.snb-vba.eu/VBA_Dictionary_en.html