+ Reply to Thread
Results 1 to 6 of 6

Matching data in a column and extracting the rows

  1. #1
    Registered User
    Join Date
    11-25-2014
    Location
    Leeds, England
    MS-Off Ver
    2010
    Posts
    49

    Matching data in a column and extracting the rows

    Hi

    I have a series of 10 digit numbers in column A, I am trying to extract any rows where the numbers are the same and place then in a separate sheet (sheet2). Can anyone suggest how I can accomplish this using VBA.

    Thanks

  2. #2
    Forum Expert sourabhg98's Avatar
    Join Date
    10-22-2014
    Location
    New Delhi, India
    MS-Off Ver
    Excel 2007, 2013
    Posts
    1,899

    Re: Matching data in a column and extracting the rows

    hello
    can you please attach your workbook

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,466

    Re: Matching data in a column and extracting the rows

    You could probably add a helper column and use COUNTIF to check how many you have of each code. Then filter on the helper column for values greater than one. Select the visoble cells and copy them to another sheet.

    Record a macro while you undertake the process. And then ask for help to tweak and generalise it

    A sample workbook would help to ensure you get what you want rather than what you've described.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Matching data in a column and extracting the rows

    Hello... Not sure if this is what you're trying to achieve?

    I've just hard coded as sample for you.. Please test and let me know.

    Place in a standard module

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    11-25-2014
    Location
    Leeds, England
    MS-Off Ver
    2010
    Posts
    49

    Re: Matching data in a column and extracting the rows

    That code is awesome. However it only pulls 1 entry out. How do I get it to pull every matching entry out?

  6. #6
    Registered User
    Join Date
    03-12-2014
    Location
    India
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: Matching data in a column and extracting the rows

    Hmm it should pull every matching entry out... Are you saying that you want to pull out the 1st entry as well? the one it's using to compare and remove everything else??

    If that's the case then, the below modification should resolve the issue for you!

    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] extracting rows of data from on sheet to another based on Column A
    By sdehod in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-13-2014, 03:48 PM
  2. Replies: 6
    Last Post: 08-08-2013, 06:50 PM
  3. Sum matching column data in a variable range of rows
    By Carcophan in forum Excel Formulas & Functions
    Replies: 8
    Last Post: 04-04-2013, 02:55 PM
  4. [SOLVED] Extracting/matching row & column data for column greater than 0
    By trinston in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-18-2013, 01:03 PM
  5. Extracting matching data
    By nospaminlich in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-13-2006, 10:35 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