I Want to save item multiple item in one key
1. as value
2. as range (union range)
3.as number
IS Posible to save multiple variant typename of item from each key
![]()
Please Login or Register to view this content.
I Want to save item multiple item in one key
1. as value
2. as range (union range)
3.as number
IS Posible to save multiple variant typename of item from each key
![]()
Please Login or Register to view this content.
Last edited by daboho; 09-26-2018 at 11:38 AM.
![]()
"Presh Star Who has help you *For Add Reputation!! And mark case as Solve"
d(e)(1) is a range of cells and the MsgBox is expecting text.
This might work to display the cells address
MsgBox d(e)(1).Address
Or the value of the first cell
MsgBox d(e)(1)(1).Value
Surround your VBA code with CODE tags e.g.;
[CODE]your VBA code here[/CODE]
The # button in the forum editor will apply CODE tags around your selected text.
still not run AlphaFrog
Q = d(k)
Q(0) = Q(0) & "," & sn(i, 1)
Q(1) = Union(Q(1), Cells(i, 1)) 'this need to set but i can not write coding 'OBJECT REQUAIRED
Q(2) = Q(2) + 1
d(k) = Q
Last edited by daboho; 09-26-2018 at 12:34 PM.
still not understand
Sub bb()
Dim d As Object, i&, ii&, j&, sn, k, Q
sn = [a1:b6].Value
Set d = CreateObject("scripting.dictionary")
For i = 1 To UBound(sn)
k = sn(i, 1) & sn(i, 2)
If Not d.exists(k) Then
d.Add k, Array(sn(i, 1), Cells(i, 1), 1)
Else
Q = d(k)
Q(0) = Q(0) & "," & sn(i, 1)
Q(1) = Union(Q(1), Cells(i, 1))
Q(2) = Q(2) + 1
d(k) = Q
End If
Next i
For Each ky In d
If d(ky)(2) = 1 Then
d.Remove ky
End If
Next ky
For Each e In d.keys
MsgBox d(e)(0) ' this OK
MsgBox d(e)(1) ' how to d(e)(1) not error i has change to MsgBox d(e)(1)(1).Value but still error
Next e
End Sub
What is it you actually want to store in the dictionary?
What's in the range A1:B6?
If posting code please use code tags, see here.
norri i hope you understand what i want from my coding to save any variant item FOR each key
1.Save range.address 'for interior colorindex
2.save range.row 'for copy data if meet criteria from third item
3.number 'only duplikat to executed IF NUMBER > 1
NORI.png![]()
Please Login or Register to view this content.
Last edited by daboho; 09-26-2018 at 03:08 PM.
Any chance you could upload a sample workbook?
Click on GO ADVANCED, scroll down and click Manage Attachments.
I am sorri nori
My oponion single dictionary can not
Save multiple typename of item
My code has sucsess using (range.address)
![]()
Please Login or Register to view this content.
Last edited by daboho; 09-27-2018 at 06:49 AM.
You should be using Set with objects:
![]()
Please Login or Register to view this content.
Everyone who confuses correlation and causation ends up dead.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks