Error Checking in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: deleting unwanting rows

  1. #1
    New Member
    Join Date
    Mar 2002
    Posts
    20
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I am having difficulty remembering the code to delete rows I do not require in a large spreadsheet. If the cell to the left of the active cell contains a certain word (say "NONE") I want to delete the entire row plus the three rows beneath.
    Can anyone help

    Thanks

  2. #2
    MrExcel MVP Al Chara's Avatar
    Join Date
    Feb 2002
    Location
    Newark, Delaware
    Posts
    1,701
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Try the following code:

    If ActiveCell.Offset(0, -1).Value = "NONE" Then
    Range(ActiveCell, ActiveCell.Offset(3, 0)).Select
    Selection.EntireRow.Delete
    End If

    Hope this helps.
    Kind regards, Al.

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •