+ 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 in a worksheet, from
    imported data.

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

    Instead of using the above code, is there a way to delete non-blank rows in
    the same range, which meet a certain criteria? For instance, delete all the
    rows within range a1:a50000, if the value of a row contains the text "Sub
    Total"?

    I need to keep the range large, but am trying to expedite the process.

    Any and All help Is Appreciated - Thank You

  2. #2
    Peo Sjoblom
    Guest

    Re: Deleting Unique Rows

    You could use advanced filter with the criteria

    Header
    ="<>Sub Total"

    (replace header with the name of the header) or leave blank and use

    =ISERROR(SEARCH("Sub Total",A4))

    where A4 is the first cell with data in your range

    copy to another location will copy everything but those rows to a new range

    Regards,

    Peo Sjoblom


    "MWS" <MWS@discussions.microsoft.com> wrote in message
    news:6EEDE42D-26EE-4D3E-83EA-D21D112FE3CA@microsoft.com...
    > Hello, I have the following code, to delete blank rows in a worksheet,
    > from
    > imported data.
    >
    > 'Deletes blank lines, for advance filterring
    > [a1:a50000].SpecialCells(xlCellTypeBlanks).EntireRow.Delete
    >
    > Instead of using the above code, is there a way to delete non-blank rows
    > in
    > the same range, which meet a certain criteria? For instance, delete all
    > the
    > rows within range a1:a50000, if the value of a row contains the text "Sub
    > Total"?
    >
    > I need to keep the range large, but am trying to expedite the process.
    >
    > 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