+ Reply to Thread
Results 1 to 4 of 4

[Excel2010] Vlookup-esque function that copies the entire row of each match into new sheet

  1. #1
    Registered User
    Join Date
    06-19-2013
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    [Excel2010] Vlookup-esque function that copies the entire row of each match into new sheet

    Hi all--

    I've been lurking around this sub for a while now, this is the first problem I've encountered that I haven't been able to find a solution to online.

    So, I have a large (~10k line) spreadsheet that my company uses for scheduling. I've found a macro online that allows me to input a string into a prompt, then the function finds all instances of that string in the spreadsheet and copies each row with a hit on it to the next sheet.

    My problems are twofold as of now:

    I'd like to be able to input a list or table of strings and have it just output the rows of each hit to the new sheet in one fell swoop, partly because...
    When I run the macro more than once, it overwrites the previous output.

    Does anyone have any experience writing something like this?

    I'll list the code below.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: [Excel2010] Vlookup-esque function that copies the entire row of each match into new s

    Quote Originally Posted by zbrt View Post
    When I run the macro more than once, it overwrites the previous output.
    To not overwrite the data on Sheet2;

    Change this...
    j = 1

    To this...
    j = Sheets(2).Range("A" & Rows.Count).End(xlUp).Row + 1

  3. #3
    Registered User
    Join Date
    06-19-2013
    Location
    Minnesota, USA
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: [Excel2010] Vlookup-esque function that copies the entire row of each match into new s

    Awesome!

    That works perfectly!

    Now I suppose my only issue is getting the input to not be a single string at the time but rather a list of strings, i.e. a sheet with cells A1:A55 each containing a string, and the loop runs searching each one down the line until the end.

    I'll keep fiddling with it, thanks again!

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: [Excel2010] Vlookup-esque function that copies the entire row of each match into new s

    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)

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