Hi Guys,
I have a code:
i would like to access this 3 items and transpose them to another sheet.
Example:
I have a list with People. For this people (keys) they are assigned values: value1, value2 and value 3 from different columns.
So i want to have the list of people with assigned to them all items as result:
Man1, value1, value2, value3.
So my idea is to use collections (checking if Man is existing twice) and after that transpose whole dictionary to another sheet.
Please help me with code to get values from dictionary.
This is difficult for me.
Best wishes
Jacek Antek
I have a code:
Code:
Sub test()
Dim dict As Object
Dim coll As Collection
Dim key As Variant
Set dict = CreateObject("Scripting.Dictionary")
Set coll = New Collection
coll.Add ("coll1")
coll.Add ("coll2")
coll.Add ("coll3")
If Not dict.Exists("dict1") Then
dict.Add "dict1", coll
End If
Dim vitems, vkeys As Variant
vitems = dict.keys
vkeys = dict.Items
For Each key In dict
Debug.Print dict.Items(key)
Next key
Set dict = Nothing
End Sub
i would like to access this 3 items and transpose them to another sheet.
Example:
I have a list with People. For this people (keys) they are assigned values: value1, value2 and value 3 from different columns.
So i want to have the list of people with assigned to them all items as result:
Man1, value1, value2, value3.
So my idea is to use collections (checking if Man is existing twice) and after that transpose whole dictionary to another sheet.
Please help me with code to get values from dictionary.
This is difficult for me.
Best wishes
Jacek Antek
Last edited by a moderator: