+ Reply to Thread
Results 1 to 8 of 8

Copy rows with matching first column value into another sheet

  1. #1
    Forum Contributor
    Join Date
    06-23-2014
    Location
    Dubbo, Australia
    MS-Off Ver
    EXCEL 2019
    Posts
    180

    Copy rows with matching first column value into another sheet

    Hi all,

    I am confounded by this one, even though I have spent most of the day searching for an answer! In Sheet4("CareNavigator") are many columns of data, but the data I strive to search for is in Column A. There may be 2000 rows to search through, and where a row matches the value of a UserForm textfield, I'd like that entire row (and any others also matching) copied to Sheet9("Reporting").

    So for instance Column A in Sheet4 has 27 rows where the AUID is 1234567. That's the value I select in my textbox, and then following that the 27 rows are copied into Sheet9 ready to run my report.
    As the saying goes, it's "doing my head in"

    Any help greatly appreciated!

    Pete
    Pete
    Struggling Solutions Architect

  2. #2
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Copy rows with matching first column value into another sheet

    Is it possible to attach a sample workbook?
    Cheers!
    Deep Dave

  3. #3
    Forum Contributor
    Join Date
    06-23-2014
    Location
    Dubbo, Australia
    MS-Off Ver
    EXCEL 2019
    Posts
    180

    Re: Copy rows with matching first column value into another sheet

    Here's an example of the spreadsheet with the userform. The CmdClick has no code behind it - yet!!!
    Attached Files Attached Files

  4. #4
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Copy rows with matching first column value into another sheet

    Hi,

    Check out the file attached..
    Attached Files Attached Files

  5. #5
    Forum Contributor
    Join Date
    06-23-2014
    Location
    Dubbo, Australia
    MS-Off Ver
    EXCEL 2019
    Posts
    180

    Re: Copy rows with matching first column value into another sheet

    Thanks NeedForExcel,

    That runs perfectly
    BUT... I had to edit one line to read Sheets("CARENAVIGATOR").Select, then it worked!

    cheers and thank you ever so much for being so speedy!
    Pete

  6. #6
    Forum Expert NeedForExcel's Avatar
    Join Date
    03-16-2013
    Location
    Pune, India
    MS-Off Ver
    Excel 2016:2019, MS 365
    Posts
    3,873

    Re: Copy rows with matching first column value into another sheet

    Not sure why you needed to edit one line to read Sheets("CARENAVIGATOR").Select

    Any ways, glad I could help..

  7. #7
    Forum Expert
    Join Date
    12-10-2006
    Location
    Sydney
    MS-Off Ver
    Office 365
    Posts
    3,525

    Re: Copy rows with matching first column value into another sheet

    Hi Pete,

    Here's one way to do it:

    Please Login or Register  to view this content.
    You could also give some thought to populating the TxtAUID text box with the unique entries from Col. A of Sheet4 to eliminate any data entry error (though I have included a routine for this in the above).

    Regards,

    Robert
    ____________________________________________
    Please ensure you mark your thread as Solved once it is. Click here to see how
    If this post helps, please don't forget to say thanks by clicking the star icon in the bottom left-hand corner of my post

  8. #8
    Forum Contributor
    Join Date
    06-23-2014
    Location
    Dubbo, Australia
    MS-Off Ver
    EXCEL 2019
    Posts
    180

    Re: Copy rows with matching first column value into another sheet

    Thanks Robert,

    I shall put that version into the solutions list that I have!

    regards
    Pete

+ 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] Copy rows with matching value from different sheets into new sheet
    By balston2 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-11-2013, 01:10 PM
  2. [SOLVED] for each sheet with first 3 char matching variable, copy column C to Target sheet unless..
    By Spyderz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-11-2012, 08:17 AM
  3. Within a loop, need to copy all rows from one sheet to another upon matching criteria
    By ripvanbrown in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-17-2012, 03:52 PM
  4. Replies: 14
    Last Post: 03-16-2011, 11:40 AM
  5. [SOLVED] Copy entire rows matching condition to a new sheet
    By JP in forum Excel General
    Replies: 3
    Last Post: 05-20-2005, 07:06 PM

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