+ Reply to Thread
Results 1 to 8 of 8

Scripting Dictionary to find unique pair of values from two different columns

  1. #1
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Davenport, Iowa
    MS-Off Ver
    Excel 365
    Posts
    206

    Scripting Dictionary to find unique pair of values from two different columns

    Hi,

    I have a data set where I would like to pull the unique values out from Columns C and E, then drop them to a sheet called output, However, I the script needs to treat each value like a concatenated value of both columns, then I need the ID and Ship-to column flipped on the output. The script I am using exports this to a single column, but it needs to spit out in two separate ones.. See the attached copy for what I am trying to achieve... Script below is my failed attempt...

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sriley5; 02-28-2020 at 02:40 PM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: Scripting Dictionary to find unique values from two different columns

    Try something like this.
    Please Login or Register  to view this content.
    Best Regards,
    Maras.

  3. #3
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool HI ! Try this …


    Quote Originally Posted by sriley5 View Post
    Script below is my failed attempt
    So in this case use the Excel basics which resolve your need just with 4 statements !

    According to your attachment a VBA beginner starter demonstration :

    PHP Code: 
    Sub Demo1()
             
    Sheet2.[D5].CurrentRegion.Offset(1).Clear
        With Sheet1
    .UsedRange.Rows("2:" Sheet1.UsedRange.Rows.Count).Columns
            
    .Item(5).Copy Sheet2.[D6]
            .
    Item(3).Copy Sheet2.[E6]
        
    End With
             Sheet2
    .[D5].CurrentRegion.RemoveDuplicates Array(12), xlYes
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  4. #4
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Davenport, Iowa
    MS-Off Ver
    Excel 365
    Posts
    206

    Re: Scripting Dictionary to find unique values from two different columns

    Maras_mak,

    Looks like the modified version still looks for unique found in the ID column, I need the unique values of the combined Customer and ID - Sorry if I didnt make that clearer in my first posting

  5. #5
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Davenport, Iowa
    MS-Off Ver
    Excel 365
    Posts
    206

    Re: HI ! Try this …

    Marc L,

    Works like a charm Thank you

  6. #6
    Forum Contributor
    Join Date
    12-14-2012
    Location
    Davenport, Iowa
    MS-Off Ver
    Excel 365
    Posts
    206

    Edit to Maras_Mak

    maras_mak.

    Question, is there a way the script you wrote can be modified to pull the unique pairs found in column 3 and 5? your original is close, although it is finding the unique values only found in column 5

    Please Login or Register  to view this content.
    Last edited by sriley5; 02-28-2020 at 02:39 PM.

  7. #7
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Arrow


    Yes, just concat the columns as keys for example (different ways but using the Excel basics is so easy and works too on Mac)

  8. #8
    Valued Forum Contributor
    Join Date
    07-14-2017
    Location
    Poland
    MS-Off Ver
    Office 2010
    Posts
    528

    Re: Scripting Dictionary to find unique pair of values from two different columns

    Does that give you the results you expect?
    Please Login or Register  to view this content.

+ 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] Scripting Dictionary to update values
    By sriley5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-24-2019, 01:22 PM
  2. [SOLVED] Scripting Dictionary to compare two columns and output a result
    By sriley5 in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 06-15-2018, 09:34 PM
  3. [SOLVED] Scripting Dictionary to return unique values
    By sriley5 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-13-2018, 05:48 AM
  4. Scripting Dictionary (working as vlookup) and add calculated columns
    By mumsys in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-23-2016, 04:49 AM
  5. Remove null value from Unique Mailing List while using Scripting.Dictionary
    By Saarang84 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-04-2016, 01:15 PM
  6. Help using Scripting Dictionary to sum values
    By welchs101 in forum Excel Programming / VBA / Macros
    Replies: 22
    Last Post: 08-09-2014, 04:15 PM
  7. [SOLVED] Add & calculate Values in Scripting.Dictionary
    By girish.talele in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 12-21-2012, 06:32 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