+ Reply to Thread
Results 1 to 6 of 6

Mass Delete Rows with specific phrase

  1. #1
    Registered User
    Join Date
    06-30-2011
    Location
    Texas
    MS-Off Ver
    Excel 2010
    Posts
    1

    Mass Delete Rows with specific phrase

    I have a massive amount of data and want to delete all rows that contain "2007" in any cell in that row. Any tips?

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: Mass Delete Rows with specific phrase

    washburn321,

    Welcome to the forum. You could use a macro. To add a macro to a workbook:
    1. Save a copy of the Excel workbook you want to modify
      • Always test macros in a copy so that the original is preserved in case the modifications don't go smoothly
    2. Open the copy of the Excel workbook you want to modify
    3. Use the keyboard shortcut ALT+F11 to open the Visual Basic Editor
    4. Insert -> Module
    5. Copy/Paste the code into that area

    To run a macro in a workbook:
    1. In Excel (not the Visual Basic Editor) press the keyboard shortcut ALT+F8
    2. Double-click the desired macro (I named this one MassDeleteMacro_for_washburn321)

    Macro code:
    Please Login or Register  to view this content.


    Hope that helps,
    ~tigeravatar

  3. #3
    Registered User
    Join Date
    03-26-2014
    Location
    NC, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Mass Delete Rows with specific phrase

    Hello, I need to find and delete all rows that contain the words "Job Date:". Can you help me with a macro for that? Thanks!

  4. #4
    Registered User
    Join Date
    03-25-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Mass Delete Rows with specific phrase

    Please Login or Register  to view this content.
    I guess this will be the formula, based upon the previous macro. Just change the String value.

  5. #5
    Registered User
    Join Date
    03-26-2014
    Location
    NC, USA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: Mass Delete Rows with specific phrase

    I get a "Compile Error" Invalid outside procedure. I'm a total novice, so please forgive me. I copied the part above starting at "Const" though "xlShiftUp", saved it then ran that macro. Am I even doing that part correctly?

  6. #6
    Registered User
    Join Date
    03-25-2014
    Location
    Chicago
    MS-Off Ver
    Excel 2010
    Posts
    14

    Re: Mass Delete Rows with specific phrase

    Yes, that should be correct if you are entering it into an already existing macro.

    I just tested the macro, worked perfectly for me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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