+ Reply to Thread
Results 1 to 3 of 3

Combine Columns Leaving Only Duplicates

  1. #1
    Registered User
    Join Date
    10-31-2008
    Location
    Alpharetta, GA
    Posts
    2

    Combine Columns Leaving Only Duplicates

    Alright, everyone. I have a real conundrum for you all... or at least, it's a toughie for me... Probably really simple for someone.

    Here's what I have:


    Please Login or Register  to view this content.
    Here's what I need:

    Please Login or Register  to view this content.
    My worksheet continues a few thousand rows down (Pulling data off a SQL DB) And what I want is to be able to compare columns B and C and identify duplicates. I currently have this running:

    Please Login or Register  to view this content.

    Plagiarized... erm, I mean, ADAPTED directly from http://support.microsoft.com/kb/213367 . But it's giving me a somewhat undesirable result:


    Please Login or Register  to view this content.
    As you can see, it is indeed isolating the matches, as I requested, but it's placing the matching numbers (x) directly to the left -- x.Offset(-1, 0) -- of the selection. This wouldn't be a problem if my spreadsheet wasn't thousands of excruciating rows deep.

    What I really need is to have it list only the matches, (really anywhere, but preferably in Column A) without me having to scroll across the entire length of the sheet. Also, it would be nice if this could be done without VB. The VB Script takes forever.

    Cookies for the first person to help me!

  2. #2
    Registered User
    Join Date
    10-20-2008
    Location
    India
    Posts
    8

    Combine Columns Leaving Only Duplicates

    You can use Cells function instead of x.offset. Just use a variable i and initialize it with one. if value matches then set value of column by cells(1,i).value and increase the value of i by 1. so that next time if value matches it enters value in second cell of the column.

    Hope that helps

  3. #3
    Registered User
    Join Date
    10-31-2008
    Location
    Alpharetta, GA
    Posts
    2
    I understand what you mean, but I don't have any real VB experience to speak of. Could you give me an example... please?

    And you get a cookie!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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