BarryL
Well-known Member
- Joined
- Jan 20, 2014
- Messages
- 1,436
- Office Version
- 2019
- Platform
- Windows
- MacOS
Hi All,
I have the below which is supposed to be adding a range of text values to a dictionary however when I debug.print it nothing is being added. list1 is defined as a variant.
I have the below which is supposed to be adding a range of text values to a dictionary however when I debug.print it nothing is being added. list1 is defined as a variant.
Code:
Set d = CreateObject("scripting.dictionary")
list1 = ThisWorkbook.Sheets("Summary").Range("A7:A22").Value
For e = LBound(list1) To UBound(list1)
On Error Resume Next
d.Add list1(e, 1), 1
Debug.Print d.Item(e)
Next e