Results 1 to 5 of 5

Thread: EXCEL: What is proper "Type" for Dictionary Key [RESOLVED - Variant!]

Threaded View

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Resolved EXCEL: What is proper "Type" for Dictionary Key [RESOLVED - Variant!]

    Esteemed Forum Participants and Lurkers:
    ===============================
    Excel 2003, Microsoft Runtime Scripting Library

    I can't figure out what the proper "Type" is for Dictionary Keys. The following code runs without Option Explicit, but how do I "Dim" a key variable so that I can turn Explicit back on?
    Code:
    Sub junk()
        'Dictionary requires Microsoft Scripting Runtime in the "Tools > References" List
        Dim aList As Dictionary
        Dim aKey ' As ????????  '<< What is proper Type?
        Set aList = New Scripting.Dictionary
        
        aList.Add "Magic", "Treasure"
        
        For Each aKey In aList.Keys
            Debug.Print aKey, aList.Item(aKey)
        Next
    End Sub
    Thank you for any and all suggestions, comments, and assistance.
    Last edited by Webtest; Oct 26th, 2005 at 11:07 AM. Reason: [RESOLVED]
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

Posting Permissions

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



Click Here to Expand Forum to Full Width