Searching cells for keyword and moving row to new sheet

  • Hi,I'm trying to workout how to do the following:1. search the activesheet column G for a keyword that i enter into an input box. 2. when a cell is found containinig that word i then want to select the row and move a copyt into a new sheet.3. repeat the process until all rows have been searched and a new sheet contains all those that matched4. on the new sheet compare the cell in the column containing the keyword and the cell to the left, if they don't both contain the keyword then highlight both cells in yellow.I've attached an example of what the initial sheet would look like and have struggled to find anything close to what i want to do.Thanks in advance for any help you can provide.

  • Re: Searching cells for keyword and moving row to new sheet


    Hi Daren. Try:

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Re: Searching cells for keyword and moving row to new sheet


    Quote from Mumps;682314

    Hi Daren. Try:


    Thanks that works really well and makes sense. What if I want to create a sheet with the foundval name? But only create the sheet it if it exists already otherwise update the existing sheet?

  • Re: Searching cells for keyword and moving row to new sheet


    Try:

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Re: Searching cells for keyword and moving row to new sheet


    Quote from Mumps;682432

    Try:


    Thanks Mumps, that works great. The idea of not creating a new sheet if it exists is so that if i use the same workbook with new data, it can add new rows to the existing sheet if i use the same foundval. How do I get it to carry out that task. Currently if I repeat the process and use the same foundval, it just highlights the columns w and v on sheet1.

  • Re: Searching cells for keyword and moving row to new sheet


    I'm not exactly sure what you mean. The macro as it currently stands, creates a new sheet if it doesn't already exist and then copies the appropriate rows to that new sheet. If you run the macro again using the same foundVal, it will simply copy the matching rows adding them to any rows that may already exist in that sheet. Perhaps you can attach a copy of your file and include a detailed explanation of exactly what you would like to do. I will be out of town for three weeks starting tomorrow so I may not be able to respond to your request during this time.

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

  • Re: Searching cells for keyword and moving row to new sheet


    Hi Mumps, I added an additional line to select the existing sheet if it already exists.



    Thanks for your help with this, I'm a very happy man...

  • Re: Searching cells for keyword and moving row to new sheet


    My pleasure. :)

    You can say "THANK YOU" for help received by clicking the "Like" icon in the bottom right corner of the helper's post.
    Practice makes perfect. I am very far from perfect so I'm still practising.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!