+ Reply to Thread
Results 1 to 4 of 4

How to find and delete rows based on criteria within a given column

  1. #1
    Registered User
    Join Date
    07-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    88

    How to find and delete rows based on criteria within a given column

    Hello,

    I want my macro to delete any rows in a certain worksheet where the value in column A begins with an open parenthesis "(".

    I've included an attachment to illustrate my question. In the example, row 13 contains a sort of total for each column. The number of groups in column A can change daily, so depending on the number of groups in the worksheet, the "total" row could be anywhere. I want to delete this row from the worksheet, and the only way I can think to distinguish this row from my pertinent data is that it will always begin with a "(" in column A. Alternatively, there will always be a space between the last line of data and this total row, so maybe there's a way to use that to pare off the bottom "total" row?

    Thank you very much for reading my question.

    -Student1990IDRowandDelete_MACRO.xlsx

  2. #2
    Registered User
    Join Date
    12-04-2012
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: How to find and delete rows based on criteria within a given column

    Is it always the last row?
    If so,
    activesheet.cells(activesheet.rows.count,1).end(xlup).entirerow.delete

  3. #3
    Forum Expert millz's Avatar
    Join Date
    08-14-2013
    Location
    Singapore
    MS-Off Ver
    Excel, Access 2016
    Posts
    1,694

    Re: How to find and delete rows based on criteria within a given column

    Try this:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    03-28-2012
    Location
    TBA
    MS-Off Ver
    Office 365
    Posts
    12,454

    Re: How to find and delete rows based on criteria within a given column

    Try the attached.
    Attached Files Attached Files

+ 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. Find and Delete rows based on criteria in multiple columns
    By Doctor_H in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2013, 08:03 PM
  2. Delete Multiple Rows Based on Criteria in 1 Column
    By Farmer12345 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-20-2013, 04:41 PM
  3. Find rows and delete them based on multiple criteria
    By kostas in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-31-2012, 11:59 AM
  4. Delete Rows Based on Column Criteria
    By telnoman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-22-2010, 09:31 AM
  5. Delete Rows based on criteria in Column A (not working)
    By Mslady in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-28-2005, 08:27 PM

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