+ Reply to Thread
Results 1 to 3 of 3

Removing all rows that contain letters

  1. #1
    fred
    Guest

    Removing all rows that contain letters

    I'm trying to remove all rows that contain letters, using a macro. I hope
    this is easily possible. Thanks

  2. #2
    Tom Ogilvy
    Guest

    Re: Removing all rows that contain letters

    Dim rng as Range
    On Error Resume Next
    set rng = Cells.SpecialCells(xlConstants,xlTextValues)
    rng.EntireRow.Delete
    set rng = Cells.SpecialCells(xlForulas,xlTextValues)
    rng.EntireRow.Delete
    On Error goto 0
    --
    Regards,
    Tom Ogilvy

    "fred" <fred@discussions.microsoft.com> wrote in message
    news:14791BB5-8A08-4ECB-BD84-16C91E2AA38F@microsoft.com...
    > I'm trying to remove all rows that contain letters, using a macro. I hope
    > this is easily possible. Thanks




  3. #3
    Tom Ogilvy
    Guest

    Re: Removing all rows that contain letters

    here is a fixed version:

    Sub DeleteRowsWithText()
    Dim rng As Range
    On Error Resume Next
    With ActiveSheet
    Set rng = .Cells.SpecialCells(xlConstants, xlTextValues)
    Intersect(rng.EntireRow, .Rows).Delete
    Set rng = .Cells.SpecialCells(xlFormulas, xlTextValues)
    Intersect(rng.EntireRow, .Rows).Delete
    End With
    On Error GoTo 0
    End Sub


    --
    Regards,
    Tom Ogilvy

    "Tom Ogilvy" <twogilvy@msn.com> wrote in message
    news:%23lqCIHsEFHA.3492@TK2MSFTNGP12.phx.gbl...
    > Dim rng as Range
    > On Error Resume Next
    > set rng = Cells.SpecialCells(xlConstants,xlTextValues)
    > rng.EntireRow.Delete
    > set rng = Cells.SpecialCells(xlForulas,xlTextValues)
    > rng.EntireRow.Delete
    > On Error goto 0
    > --
    > Regards,
    > Tom Ogilvy
    >
    > "fred" <fred@discussions.microsoft.com> wrote in message
    > news:14791BB5-8A08-4ECB-BD84-16C91E2AA38F@microsoft.com...
    > > I'm trying to remove all rows that contain letters, using a macro. I

    hope
    > > this is easily possible. Thanks

    >
    >




+ 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