+ Reply to Thread
Results 1 to 4 of 4

pass array into dictionary to sum product by description and type

  1. #1
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    pass array into dictionary to sum product by description and type

    Hi All

    Output from a database records in strings product items. The following code divides those string into block of three into a public array called temp

    Please Login or Register  to view this content.
    And dictionary
    Please Login or Register  to view this content.
    I have used dictionary's but cannot find my source workbooks so would appreciate a few pointers as to how to count the various types

    I want to pass the array elements into the dictionary to give me totals of each product featured and the package type. A bonus would be any array entry containing the word "DEAL" would be omitted from the dictionary.

    Work attached shows string types from database - array formed - and desired output totals
    Many thanks
    Attached Files Attached Files
    Last edited by nigelog; 07-14-2021 at 05:09 AM.

  2. #2
    Forum Expert dangelor's Avatar
    Join Date
    09-06-2011
    Location
    Indiana, USA
    MS-Off Ver
    365 Pro Plus
    Posts
    2,278

    Re: pass array into dictionary to sum product by description and type

    Possibly...
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,259

    Re: pass array into dictionary to sum product by description and type

    It turned out a bit different for me.
    Code can be reduced by not using the Type Product, but in such a form is more understandable.
    Please Login or Register  to view this content.
    Artik

  4. #4
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: pass array into dictionary to sum product by description and type

    Thankyou both for your efforts.. I have some studying to do
    Many thanks
    After checking Artik's code does all in a single pass, I will mark as solved...thanks again to you both

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to pass dictionary from function
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-14-2018, 09:01 AM
  2. [SOLVED] Join 3 arrays/arraylist/ranges and pass them to dictionary
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-09-2018, 07:49 AM
  3. [SOLVED] Pass dictionary keys into stack object vba
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 10-09-2017, 04:06 AM
  4. Replies: 7
    Last Post: 03-12-2017, 03:20 PM
  5. How to pass dictionary from function into main sub?
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-22-2017, 07:12 AM
  6. [SOLVED] Analyze Within An Array and Pass Back Once vs. Pass at each applicable Instance
    By AlvaroSiza in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2012, 05:25 PM

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