Results 1 to 8 of 8

VBA Dictionary COUNTIF (but efficiently)

Threaded View

AB91 VBA Dictionary COUNTIF (but... 12-24-2018, 08:46 AM
davesexcel Re: VBA Dictionary COUNTIF... 12-24-2018, 08:55 AM
AB91 Re: VBA Dictionary COUNTIF... 12-24-2018, 09:06 AM
davesexcel Re: VBA Dictionary COUNTIF... 12-24-2018, 09:22 AM
AB91 Re: VBA Dictionary COUNTIF... 12-24-2018, 09:27 AM
jindon Re: VBA Dictionary COUNTIF... 12-24-2018, 09:59 AM
Fluff13 Re: VBA Dictionary COUNTIF... 12-24-2018, 10:07 AM
AB91 Re: VBA Dictionary COUNTIF... 12-24-2018, 10:09 AM
  1. #1
    Registered User
    Join Date
    09-24-2017
    Location
    London, England
    MS-Off Ver
    Excel 2016
    Posts
    15

    VBA Dictionary COUNTIF (but efficiently)

    Hi,

    I'm trying to essentially perform a COUNTIF using a dictionary in VBA as I have a ton of data.

    What I want to do is just:
    - Go through each cell in a range
    - If the cell value doesn't exist in the dictionary, add it to the dictionary with a count of 1
    - If the cell value does exist in the dictionary, update it's count field by adding 1
    - Once completed, loop back through the initial range and then output onto the sheet the count for each item

    ----------------------

    What I have done so far:
    - I've created a Class Module with two variant fields, ID and Count
    - I can then look to my range and add each item to the dictionary
    - HOWEVER, when trying to do something like:

    If MyDictionary.Exists(r.Value) Then ...

    It never works.

    If someone can help, that would be fantastic. If there is more information/code you'd like me to share, just say so.

    Thanks!
    Last edited by AB91; 12-24-2018 at 10:09 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA Dictionary Countif (type thing)
    By AB91 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-23-2018, 11:05 PM
  2. Why dictionary very slow ,is dictionary have maksimum data
    By daboho in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-30-2018, 03:57 PM
  3. Adding dictionary into dictionary and retrieving data
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-08-2018, 06:52 AM
  4. [SOLVED] Dictionary or Scripting.Dictionary. Binding Referencing Dim-ing. Sub routines and Function
    By Doc.AElstein in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 07-12-2016, 08:28 AM
  5. Storing a Dictionary into a Dictionary Object
    By pago_boss in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2015, 03:04 AM
  6. Dictionary - Using a dictionary of dictionaries to hold individual orders
    By wazimu13 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-09-2015, 08:32 PM
  7. Excel 2007 : Sum values efficiently
    By dzaboo in forum Excel General
    Replies: 0
    Last Post: 09-23-2010, 01:16 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