Results 1 to 2 of 2

Thread: Vba scripting dictionary help

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    2
    Rep Power
    0

    Vba scripting dictionary help

    Hi,

    I'd like to know where I can get resources to understand how works the scripting dictionary. I'm able to use but rather in a blind way (many tries until I find what I want...mixing the difference between items and keys... how it stores data by default? in a vertical way 2 columns n rows or horizontal way because I have seen transpose methods being used with scripting dictionary object.

    The example below illustrates one of the things I don't understand, it seems d as a dictionary objects is incremented only if variable city doesn't exist. Is it another way of looping and checking if d(city).exist then blabla?

    Code:
    Set d = New Scripting.Dictionary
    
    For i = 2 To UBound(ka, 1)
        city= ka(i, 3)
        If Len(city) > 0 Then d(city) = d(city) + 1
    Next i
    I can get things done using dictionary object but quite in an erractic way.

    Thanks if you can help me on this.

    Regards,

    Pascal Baro

    https://www.youtube.com/channel/UCnxwq2aGJRbjOo_MO54oaHA
    Last edited by DocAElstein; 10-02-2023 at 12:40 PM.

  2. #2
    Administrator Admin's Avatar
    Join Date
    Mar 2011
    Posts
    1,123
    Rep Power
    10
    Cheers !

    Excel Range to BBCode Table
    Use Social Networking Tools If You Like the Answers !

    Message to Cross Posters

    @ Home - Office 2010/2013/2016 on Win 10 (64 bit); @ Work - Office 2016 on Win 10 (64 bit)

Similar Threads

  1. Excel VBA Dictionary Object
    By Rajan_Verma in forum Rajan Verma's Corner
    Replies: 1
    Last Post: 05-13-2012, 10:01 PM

Posting Permissions

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