+ Reply to Thread
Results 1 to 3 of 3

Deleteing some Rows

  1. #1
    Deepwater
    Guest

    Deleteing some Rows

    I am looking for some help to delete the rows in a sheet which have some
    Specific words in the cell.

    For example: i have sub total for every 10 to 15 lines and would like to
    find out the cell which have "sub total" word int it and delete the whole row.

    Thanks in advance

  2. #2
    Forum Expert Ron Coderre's Avatar
    Join Date
    03-22-2005
    Location
    Boston, Massachusetts
    MS-Off Ver
    2013, 2016, O365
    Posts
    6,996
    You might want to try an AutoFilter
    DATA>FILTER>AUTOFILTER

    After filtering to only show the rows that have "SUB TOTAL", Select those rows and delete them. Be aware that WHOLE ROWS will be deleted so watch out for data to the sides.

    Then turn off the AutoFilter (same command DATA>FILTER>AUTOFILTER)

    The remaining rows should appear.


    One more thing...
    If the subtotals got there because you used the DATA>SUBTOTALS functionality, then you can remove them by using:
    DATA>SUBTOTALS then clicking the Remove Subtotals button.

    Does that help?

    Regards,
    Ron
    Last edited by Ron Coderre; 04-01-2005 at 01:43 PM.

  3. #3
    Jason Morin
    Guest

    Re: Deleteing some Rows

    One way:

    Sub DeleteRow()
    'Adapted from Microsoft code found at
    'msdn.microsoft.com
    Dim sFind As String
    Dim Rng As Range
    Dim sFindRow As Long
    sFind = "*sub*total*"
    Set Rng = Range("A:A").Find(What:=sFind, lookat:=xlWhole)
    While Not Rng Is Nothing
    sFindRow = Rng.Row
    Rng.EntireRow.Delete
    Set Rng = Range("A" & sFindRow - 1 & ":A" & _
    Rows.Count) _
    .Find(What:=sFind, lookat:=xlWhole)
    Wend
    End Sub

    To run, press ALT+F11, go to Insert > Module, and paste
    in the code above. Press ALT+Q. And go to Tools > Macro >
    Macros to run. This assumes you have data in col. A.

    HTH
    Jason
    Atlanta, GA, USA

    >-----Original Message-----
    >I am looking for some help to delete the rows in a sheet

    which have some
    >Specific words in the cell.
    >
    >For example: i have sub total for every 10 to 15 lines

    and would like to
    >find out the cell which have "sub total" word int it and

    delete the whole row.
    >
    >Thanks in advance
    >.
    >


+ 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