+ Reply to Thread
Results 1 to 5 of 5

Macro to delete entire row if cell contains the word "total" or "Total"

  1. #1
    Registered User
    Join Date
    11-17-2010
    Location
    Westbrook, Maine
    MS-Off Ver
    Excel 2007
    Posts
    15

    Macro to delete entire row if cell contains the word "total" or "Total"

    I have a large amount of data that started as a Pivot Table. I pasted it into a new Worksheet as values only. Now I need a Macro to delete all rows that have a cell containing the word "Total." I have found a few macros online, but they are all specific to a certain columns. I need a Macro that will search the entire sheet. The cells may or may not contain other words along with Total (for example, Apples Total, Grapes Total, Pears Total).

    Any help would be appreciated. Thanks!

    Here are some of the strings that are somewhat relative, but I am having trouble tweaking the Macro (I keep getting Run Errors):
    http://www.excelforum.com/excel-prog...-contains.html
    http://www.ozgrid.com/forum/showthre...t=84092&page=1
    Last edited by theatricalveggie; 08-10-2011 at 10:10 AM.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Macro to delete entire row if cell contains the word "total" or "Total"

    You could try this:

    Please Login or Register  to view this content.
    Last edited by Andrew-R; 08-10-2011 at 10:20 AM.

  3. #3
    Forum Expert
    Join Date
    01-12-2007
    Location
    New Jersey
    Posts
    2,127

    Re: Macro to delete entire row if cell contains the word "total" or "Total"

    Try:

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    11-17-2010
    Location
    Westbrook, Maine
    MS-Off Ver
    Excel 2007
    Posts
    15

    Re: Macro to delete entire row if cell contains the word "total" or "Total"

    Andrew - It worked perfectly!!! Thank you so much!

  5. #5
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Macro to delete entire row if cell contains the word "total" or "Total"

    If that takes care of your need, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

+ 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