+ Reply to Thread
Results 1 to 3 of 3

Get Unique values from one column and the values on the same row from another column

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Get Unique values from one column and the values on the same row from another column

    Hello all,

    The following code gives me the unique values from column E in column R

    Sheets("DATABASE").Range("E:E").Copy Sheets("DATABASE").Range("R1")
    Sheets("DATABASE").Range("R:R").RemoveDuplicates Columns:=1, Header:=xlNo
    However I'd like to get the values from column G as well.
    So I need the code to get all unique values from column E in column R and the values from column G (that are on the same row as the unique values from column E) in column S

    All help is welcome

  2. #2
    Forum Expert nilem's Avatar
    Join Date
    10-22-2011
    Location
    Ufa, Russia
    MS-Off Ver
    2013
    Posts
    3,377

    Re: Get Unique values from one column and the values on the same row from another column

    Hi Jonathan78,
    maybe so
    With Sheets("DATABASE")
        Union(.Range("E:E"), .Range("G:G")).Copy .Range("R1")
        .Range("R:S").RemoveDuplicates Columns:=1, Header:=xlNo
    End With

  3. #3
    Forum Contributor
    Join Date
    08-19-2009
    Location
    Netherlands, Amsterdam
    MS-Off Ver
    Excel 2010
    Posts
    585

    Re: Get Unique values from one column and the values on the same row from another column

    Thanks Nilem!
    works great

+ 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] Sum values in column based on unique values in correlating column.
    By ericbinfet in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 11-04-2015, 01:04 AM
  2. [SOLVED] Sum values in column based on unique values in correlating column.
    By ericbinfet in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 11-03-2015, 11:41 AM
  3. Sum of unique values in a column based on values in another column
    By pandyav in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-07-2015, 05:30 PM
  4. Replies: 2
    Last Post: 08-19-2015, 10:22 AM
  5. Replies: 5
    Last Post: 12-24-2013, 08:38 AM
  6. [SOLVED] Pick unique values in column A and display the corresponding values from column B & C
    By nostra in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-17-2013, 01:51 AM
  7. Count Unique Values In One Column Basis Unique Values in Another Column
    By shez_raz in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-07-2012, 01:55 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