+ Reply to Thread
Results 1 to 5 of 5

Get total of an item in dictionary

  1. #1
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Get total of an item in dictionary

    Hello everyone
    I have a range in which I need to sum the total and this is the code till now
    Please Login or Register  to view this content.
    I just need help at that point ::''Need to get the total for the item

    Thanks advanced for help
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Get total of an item in dictionary

    Please Login or Register  to view this content.
    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.

  3. #3
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Get total of an item in dictionary

    Thank you very much AlphaFrog .. That solved the problem
    But I need to understand this point as I can't get it

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: Get total of an item in dictionary

    dic.Item(k)(1)

    This returns the key value for Item(k) in the dictionary. The key, in this case, is a zero-based one-dimensional array with two elements. Element(0) in the array is the the same as the Item(k). Element (1) in the array is the total. The (1) on the end references the second element in the array. I hope that helps. I don't know how else to explain it.

    I'm not sure why the key value is made as an array in the first place. An array is not needed as the first element in the array is just duplicate of the Item value.

  5. #5
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,892

    Re: Get total of an item in dictionary

    Thank you very much for this great explanation. I could get it now
    In fact array used because there are other fields that will be added not just two fields .. I just wanted to simplify the issue
    Best Regards

+ 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] Excel VBA: Put dictionary key and item in columns without transposing
    By manofcheese in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-20-2015, 10:01 AM
  2. [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
  3. [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
  4. [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
  5. [SOLVED] accesing class members of an object returned by dictionary item
    By vientito in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-20-2014, 05:08 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