I'm struggling with the same kind of problem for weeks. I thought now is the time to as professionals on the web:
Dim txt, show As String
Dim NameList(1 to 50) as Varriant
Dim i, j, t As Integer
t = 1
For i = 1 To 10
For j = 1 To 5
NameList(t) = Sheets("Sheet2").Cells(i, j).Value
nshow = nshow & i & " " & t & " " & NameList(t) & vbCrLf
t = t + 1
Next j
Next i
MsgBox nshow
This is the code to put all the following data in an array(see picture):
after I run I get the following:
I think I got the following cell value in an array: NameList(a 8 , k 2, u 2,e 2, o 2, etc....)
My question is how can I clean my array so that their is no duplicated (more than 1 same value). I would like to have NameList(a 8 , k 2, u 2, e 2, x 11, c 1, m 1, d 2, r 1, o 2, y 1, i 1, f 1, p 1, z 1, g 2, q 2, h 1, b 2, l 1, v 1, j 1, t 2, n 1) No duplicated data.
I would like to appreciate, help!
Dictionary
object. Add each value as a key to the dictionary - but only if this keys does not already exist. In the end, simply loop over the keys. Similar approach is used herex=Range("A1").Resize(100,10).Value
syntax.