+ Reply to Thread
Results 1 to 6 of 6

Search for variable and copy row

  1. #1
    Registered User
    Join Date
    05-26-2008
    Location
    Niagara Falls, Canada
    Posts
    4

    Search for variable and copy row

    I've been searching for the answer to my question, but I can't seem to find it.

    Firstly, I have three worksheets, the first (Master) is a master list of roll numbers, names and addresses. The second (Roll Numbers) is a list of roll numbers, and the third is where I want my output (Addresses).

    What I want to do is select the first value from the list of roll numbers, find that value in the master sheet, then copy the master sheet's entire row and paste it into the addresses sheet in a row corresponding to the Roll Number's row.

    What I have looks like this:
    Please Login or Register  to view this content.
    Roll number only has one column, A1 is a title, and the data starts from A2 to any length of roll numbers.

    Master has 15 columns, and the roll numbers are located in K

    Addresses will simply look like a shortened Master sheet.

    This doesn't actually work, and only runs once (doesn't goto cell A3 and start the search again) If someone could help me it would be greatly appreciated.

  2. #2
    Registered User
    Join Date
    05-26-2008
    Location
    Niagara Falls, Canada
    Posts
    4

    Attached File

    I've attached a modified file with an example of what I'm requesting. The file also has a completed Addresses page with the end result that I am looking for. This page would normally only start with the headers.
    Attached Files Attached Files

  3. #3
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967
    Try this shortened macro

    Please Login or Register  to view this content.
    Martin

  4. #4
    Registered User
    Join Date
    05-26-2008
    Location
    Niagara Falls, Canada
    Posts
    4

    Perfect!

    Works perfectly, but how do I now get it to do an entire list in the Roll Numbers sheet?

  5. #5
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    One way using mrice code

    Please Login or Register  to view this content.
    HTH
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  6. #6
    Registered User
    Join Date
    05-26-2008
    Location
    Niagara Falls, Canada
    Posts
    4

    Exactly what I needed

    Thank you for the help, it works perfectly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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