The bottom line is, I break a word into an array of words on the separator /, fill the partsWord collection with these values. But I have a collection of groups that must store the partsWords collection, and it’s impossible to do it ...

Dim variants As New Collection Dim groups As Collection ... Set groups = New Collection For Each word In words Set variants = New Collection partsWord = Split(word, "/") For Each part In partsWord variants.Add (part) Next groups.Add (variants) 'не получается Next 

    1 answer 1

    In the groups.Add (variants) row, remove the brackets to make groups.Add variants .
    Also, part and word must be declared as a Variant or Object data type. Perhaps this is what you have done, but this is not visible in the presented code.