Good Afternoon, so for the past few weeks I've been trying to better understand the reasoning behind this run-time error whenever I try to remove unique (case sensitive) duplicates (ie. HOSTID and HostID should not be considered duplicates of each other.) This continue's to stem from my initial question here: Run Time Error when running a VBA string to remove unique duplicates
Shoutout to @BigBen for the assistance but unfortunately I'm still having some issues all depending on how I play around with the code.
Sheets("Analysis").Select
Dim x, dict
Dim lr As Long
lr = Cells(Rows.Count, 1).End(xlUp).Row
x = Range("AA1:AA" & lr).Value
Set dict = CreateObject("Scripting.Dictionary")
For i = 1 To UBound(x, 1)
dict.Item(x(i, 1)) = ""
Next i
Range("AA1:AA" & lr).ClearContents
Range("AA1").Resize(dict.Count).Value = Application.Transpose(dict.keys)'''
grants me a mismatch error highlighting For i = 1 To UBound(x, 1)
If I try to be cheeky and use x = Range("AA1:AA100000" & lr).Value and Range("AA1:AA100000" & lr).ClearContents respectively, I don't get an error but half of my host id's get pushed all the way to the bottom of the excel document (and duplicates remain)
Please, any assistance would be appreciated. Youtubing this has been useless and I'm unable to find any article that seems relevant.