+ Reply to Thread
Results 1 to 12 of 12

How to understand and use CreateObject("Scripting.Dictionary")

  1. #1
    Registered User
    Join Date
    09-20-2012
    Location
    New york
    MS-Off Ver
    Excel 2003
    Posts
    45

    How to understand and use CreateObject("Scripting.Dictionary")

    I want to search an multi-dimensional array which would be several columns J,K,N and extract unique items I was hoping to accomplish this by learning how to understand the above title. If anyone could point me in the direction of a good source or guide I would greatly appreciate it!

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Darthzo,

    Please post your workbook/worksheet.

    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.

  4. #4
    Registered User
    Join Date
    09-20-2012
    Location
    New york
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    VBA Scripting.xlsThank you stanleydgromjr I created a sample sheet as this would be quicker than revising the original one. I would like to understand how to take the data on both list insert them into an array and extract only the unique item from that list.

  5. #5
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Darthzo,

    Thanks for the workbook.

    Can we have another workbook, with worksheet Unique List of items manually created by you for the results that you are looking for.

  6. #6
    Registered User
    Join Date
    09-20-2012
    Location
    New york
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Revised workbook thanks again for the assistance.VBA Scripting v2.xls

  7. #7
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Darthzo,

    Thanks.

    With your raw data in worksheet A List, the results will be put into worksheet Unique List of items.

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the GetUniqueList macro.

  8. #8
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Darthzo,

    If you want to get the unique data from both the A List and the B List then:

    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    Please Login or Register  to view this content.
    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then run the GetUniqueListV2 macro.

  9. #9
    Registered User
    Join Date
    09-20-2012
    Location
    New york
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Thank you Stanleydgromjr I am gonna test it out now

  10. #10
    Registered User
    Join Date
    09-20-2012
    Location
    New york
    MS-Off Ver
    Excel 2003
    Posts
    45

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Stanleydgromjr it works nicely could you do one last thing and give me a breakdown of how it works I was stepping through the code and catch everything. Thanks again greatly appreciated.

  11. #11
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Darthzo,

    Thanks for the feedback.

    You are very welcome. Glad I could help.

    could you do one last thing and give me a breakdown of how it works
    Be back in a little while.

  12. #12
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: How to understand and use CreateObject("Scripting.Dictionary")

    Darthzo,

    See the BOLD instructions (I hope they help).

    Please Login or Register  to view this content.
    Last edited by stanleydgromjr; 04-03-2013 at 07:38 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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