+ Reply to Thread
Results 1 to 6 of 6

Delete Table Rows Based on Specific Text

  1. #1
    Registered User
    Join Date
    05-06-2014
    Location
    Morrisville, NC
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    43

    Delete Table Rows Based on Specific Text

    I have tried a few different scripts and just can't seem to get one to work correctly.

    I am looking for a macro that will simply perform this action prior to me exporting this table to access.

    I have a table on my sheet ExportSheet, called "GroupAuxDaily". The headers of the table start at G5 and can vary in length depending on the daily data entered.

    When someone enters the data into this table, there is a pesky "Total" row that always export from the program. We paste multiple instances of this report one below another, so simply removing the first row doesn't work for the others.

    Essentially what I need is a macro that will do the following:
    In Table "GroupAuxDaily" remove any row where text "Totals" exists in the first column (G).


    This will be placed before my export to Access code. thanks in advance!

  2. #2
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Delete Table Rows Based on Specific Text

    This isn't very elegant, but it sounds as if something like this is all you need:

    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    05-06-2014
    Location
    Morrisville, NC
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    43

    Re: Delete Table Rows Based on Specific Text

    I am looking for an approach that will do this for the Table Rows, not spreasheet rows. I have other tables to the left and right of this one.
    ADD REPUTATION below the posts to say thanks!

  4. #4
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: Delete Table Rows Based on Specific Text

    Ah.

    The whole row can't be deleted then, obviously. But you can delete just the data (the total figures) in the table, I think. How many columns is your GroupAuxDaily table? If it's located in columns A through G, for example, then something like this should work:

    Please Login or Register  to view this content.

    You can also put that in a loop, of course:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-06-2014
    Location
    Morrisville, NC
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    43

    Re: Delete Table Rows Based on Specific Text

    I have been messing with this. It selects a cell of the rows that it pertains to and deletes such rows, however I am getting a 1004 error now (Delete method of Range Class Failed). This code properly selects the correct rows, but getting it to delete is a pain.

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    05-06-2014
    Location
    Morrisville, NC
    MS-Off Ver
    Excel 2010, Excel 2013
    Posts
    43

    Re: Delete Table Rows Based on Specific Text

    Solved

    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. Delete Rows with specific text in specific column
    By love2waltz in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-12-2015, 10:16 AM
  2. Delete / Keep rows containing specific text.
    By fluteloop in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 09-30-2014, 06:48 PM
  3. [SOLVED] delete alot of rows with a specific value from a table
    By uimhirADo in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 09-03-2013, 05:26 PM
  4. [SOLVED] Delete Rows With Specific Text
    By Sean in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-19-2006, 10:50 AM
  5. Delete rows with specific text
    By MAYDAY in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-08-2005, 11:05 AM

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