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

Thread: Delete rows

  1. #1
    New Member
    Join Date
    Apr 2002
    Location
    Holland
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Is there a way to automatically delete rows in a worksheet based upon the entry in the left cell of the row?
    Thanks

  2. #2
    Board Regular
    Join Date
    Apr 2002
    Posts
    237
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Put the cursor in the top cell of the column and replace the questionmark with your contents you are looking for.

    Sub del_rows()
    While ActiveCell.Value = "?"
    If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
    ActiveCell.Offset(1, 0).EntireRow.Delete
    Else
    ActiveCell.Offset(1, 0).Select
    End If
    Wend
    End Sub

  3. #3
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-09 08:00, JAYLO wrote:
    Put the cursor in the top cell of the column and replace the questionmark with your contents you are looking for.

    Sub del_rows()
    While ActiveCell.Value = "?"
    If ActiveCell.Value = ActiveCell.Offset(1, 0).Value Then
    ActiveCell.Offset(1, 0).EntireRow.Delete
    Else
    ActiveCell.Offset(1, 0).Select
    End If
    Wend
    End Sub
    Can this also done with delete a column.So yes,what is then the macro?
    Many thanks

  4. #4
    Board Regular
    Join Date
    Apr 2002
    Posts
    237
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Yes.
    Change the OFFSET from 1,0 to 0,1 and the entirerow to entirecolumn

    Jay

  5. #5
    Board Regular
    Join Date
    Mar 2002
    Posts
    1,451
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    On 2002-04-09 08:09, JAYLO wrote:
    Yes.
    Change the OFFSET from 1,0 to 0,1 and the entirerow to entirecolumn

    Jay
    Yes,I have done it.But the question in case is that I want to delete every time column 11(column K)
    Can this put in this macro,and how?
    Many thanks
    Can

  6. #6
    Board Regular
    Join Date
    Mar 2002
    Location
    Oregon
    Posts
    130
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hey, not to budge in on this thread, but can you use this to delete, say, three or four rows, including the one in which the specified data is found?

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
  •