Results 1 to 11 of 11

Multiple and variant item of dictionary

Threaded View

  1. #1
    Forum Expert
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,513

    Multiple and variant item of dictionary

    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
     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)   ' THIS IS ERROR PLEASE HELP ME
    Next e
    End Sub
    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"

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Finding corresponding key in dictionary based on item value
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-12-2018, 07:38 AM
  2. [SOLVED] Get total of an item in dictionary
    By YasserKhalil in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-24-2017, 07:02 PM
  3. [SOLVED] Can a dictionary key hold more than one item?
    By dwx in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-17-2015, 07:00 AM
  4. [SOLVED] Can a dictionary key hold more than one item?
    By dwx in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-17-2015, 04:37 AM
  5. [SOLVED] If dictionary key exists add new item to existing item array
    By strud in forum Excel Programming / VBA / Macros
    Replies: 18
    Last Post: 11-25-2014, 01:54 PM
  6. Remove All Instances Of Key Item Pairs From Dictionary
    By goss in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-31-2013, 12:37 AM
  7. 2 Dimentional Array as Dictionary Item
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 05-05-2011, 11:13 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1