+ Reply to Thread
Results 1 to 2 of 2

Deleting Unique Rows

  1. #1
    MWS
    Guest

    Deleting Unique Rows

    Hello, I have the following code to delete blank rows within a worksheet.

    'Deletes blank lines, for advance filterring
    [a1:a50000].SpecialCells(xlCellTypeBlanks).EntireRow.Delete

    Question: Is there a method to delete certain rows, if a particular cell
    within a row meets certain criteria? For instance, I'd like to reference
    range a1:a50000, and delete each row within this range, if "Sub Total" is the
    value in any cell within column A.

    Is this possible and if so, how?

    Any and All Help Is Appreciated - Thank You

  2. #2
    ALe
    Guest

    RE: Deleting Unique Rows

    You could do a loop like this...

    application.screenupdating=false
    dim cell as range

    for each cell in range("a1:a50000")
    if cell.text="Sub Total" then cell.entirerow.delete
    next cell

    Of course faster ways can be used.

    "MWS" wrote:

    > Hello, I have the following code to delete blank rows within a worksheet.
    >
    > 'Deletes blank lines, for advance filterring
    > [a1:a50000].SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    >
    > Question: Is there a method to delete certain rows, if a particular cell
    > within a row meets certain criteria? For instance, I'd like to reference
    > range a1:a50000, and delete each row within this range, if "Sub Total" is the
    > value in any cell within column A.
    >
    > Is this possible and if so, how?
    >
    > Any and All Help Is Appreciated - Thank You


+ 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