+ Reply to Thread
Results 1 to 9 of 9

Copy entire row to new spreadsheet based on keyword

  1. #1
    Registered User
    Join Date
    08-07-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    13

    Copy entire row to new spreadsheet based on keyword

    Hi guys, just wondering if anybody could help me with this one.

    I have multiple Sheets Jan12,Feb12,Mar12 etc and what I would like is to search for a specific keyword in column K and if that keyword matches then it will copy the entire row containing that keyword into a new spreadsheet. So basically if there are 3 rows in Jan12, 6 rows in Feb12 and 10 rows in Mar12 containing the keyword then the resulting spreadsheet will show 19 rows containing the data copied from the other sheets.

    I have seen some examples but only ones which will work for the activesheet, I am trying to get a macro that will search in a specified number of sheets. Thanks

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy entire row to new spreadsheet based on keyword

    add a sheet named "Master" and try this macro
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    08-07-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Copy entire row to new spreadsheet based on keyword

    Hi Patel,

    No sorry that didnt seem to do anything, do you need more specific information from me? The keyword I will be using will be "Carmens". Thanks for helping btw

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Copy entire row to new spreadsheet based on keyword

    Did you change

    Please Login or Register  to view this content.
    to

    Please Login or Register  to view this content.
    If you did change sname and its not working the next step would be to upload a workbook with the more specific Information. Most of the time its easier for someone to assist when they can look at your workbook.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  5. #5
    Registered User
    Join Date
    08-07-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Copy entire row to new spreadsheet based on keyword

    Hi guys, I did change the keyword from xxx to Carmens but that didnt seem to do anything either.

    Only just realised it would be a better idea for me to upload exactly what I am after. This is the spreadsheet, but in this one It would be looking for the keyword in column F and not column K, and if possible for it to look through all the sheets within the workbook. Would greatly appreciate any help

  6. #6
    Registered User
    Join Date
    08-07-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Copy entire row to new spreadsheet based on keyword

    here is the spreadsheet
    Attached Files Attached Files

  7. #7
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Copy entire row to new spreadsheet based on keyword

    Give this a try, problem was if you were looking for Carmens and the cell value is CARMENS

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    08-07-2012
    Location
    london
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: Copy entire row to new spreadsheet based on keyword

    Hi Mike,

    Thanks for your help it works perfectly now!

    could I also just ask, is it also possible to search for more than just 1 keyword? for example if i wanted it to show results for CARMEN and JOHN would it be a case of changing the sname = CARMEN & JOHN or would I need to create an additional sname e.g.

    sname = CARMEN
    sname1 = JOHN

    and also have to change this part to:

    If UCase(.Cells(j, "F").Value) = sname & sname1 Then

    thanks alot for your help guys, saved me alot of time

  9. #9
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Copy entire row to new spreadsheet based on keyword

    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