+ Reply to Thread
Results 1 to 6 of 6

Search 3 columns for certain text and then copy the rows to new sheet

  1. #1
    Registered User
    Join Date
    07-17-2018
    Location
    KY
    MS-Off Ver
    2016
    Posts
    4

    Search 3 columns for certain text and then copy the rows to new sheet

    Hi All -

    I would like to search my first sheet "MP List" in columns C, E and F for two pieces of text "cost" and "cc" and if they exist(does not have to be unique, as long as "cost" or "cc" appear in any cell in those 3 columns, copy the entire row (Columns A:S) to a new sheet called "Cost" and delete them from the original sheet.

    Can someone help me with this?

    Most of what I've seen does not specifically search a few columns, it either searches 1 column or the entire sheet's cells.
    Last edited by mag1c; 07-17-2018 at 11:41 AM.

  2. #2
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Search 3 columns for certain text and then copy the rows to new sheet


    Hi !

    An easy beginner way : using a filter or an advanced filter …

  3. #3
    Registered User
    Join Date
    07-17-2018
    Location
    KY
    MS-Off Ver
    2016
    Posts
    4

    Re: Search 3 columns for certain text and then copy the rows to new sheet

    Quote Originally Posted by Marc L View Post

    Hi !

    An easy beginner way : using a filter or an advanced filter …
    You're absolutely right, however this is something we do weekly so it would be nice to automate. I was attempting to alter Jindon's code from another thread but don't seem to be having any luck

    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Re: Search 3 columns for certain text and then copy the rows to new sheet


    Please do not quote the whole just previous post as it's just clutter !

    As any filter or advanced filter can be used in a VBA procedure …
    Just activate the Macro Recorder and operate manually : you will get your own code base !

    In case of an optimization need, post the generated code here.

    Or at least attach a workbook with a source worksheet and an expected result worksheet
    with an explanation of your need accordingly …

  5. #5
    Registered User
    Join Date
    07-17-2018
    Location
    KY
    MS-Off Ver
    2016
    Posts
    4

    Re: Search 3 columns for certain text and then copy the rows to new sheet

    Thank you,

    the issue I have with using the Macro Recorder is that when I filter based on the word "cost" , I need to copy the entire row for any cell in that row that contains "cost" and paste it into a new sheet, then delete the the rows on the main sheet.

    The Macro creates a range of these specific rows I select and isn't repeatable because the word "cost" will not always appear in the same row, thus using the macro recorder will not bring the correct information guaranteed each time.

  6. #6
    Forum Guru
    Join Date
    08-15-2004
    Location
    Tokyo, Japan
    MS-Off Ver
    2013 O.365
    Posts
    22,523

    Re: Search 3 columns for certain text and then copy the rows to new sheet

    Do you mean filter any row that have "cost" in any column?
    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)

Similar Threads

  1. [SOLVED] Remove Rows based upon list of search terms, copy removed rows to new sheet
    By sam103329 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 02-19-2015, 08:47 PM
  2. Remove Rows based upon list of search terms, copy removed rows to new sheet
    By sam103329 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-26-2013, 10:32 PM
  3. Search row with criteria in all sheet, copy rows and paste in new created sheet
    By dekueb in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 08-24-2013, 01:42 PM
  4. Replies: 1
    Last Post: 02-27-2013, 10:33 PM
  5. Search header row for common text in cells and copy below rows to new sheet
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-19-2011, 02:23 PM
  6. Add rows and search/copy/paste text into added rows
    By HelenW in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-14-2010, 04:06 AM

Tags for this Thread

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