Thanks Thanks:  0
Likes Likes:  0
Results 1 to 3 of 3

Thread: delete rows if

  1. #1
    Board Regular
    Join Date
    Feb 2002
    Location
    Los Angeles, CA
    Posts
    752
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    I have no idea how to write a macro that would do this but this is what I need.

    If in column b the word "count" appears in a cell with other text and if next to it in column c equals "1". I want that row and the row above it to be deleted.

    Cause I don't know how to write this, I am currently doing this manually.

    Please help, I'm growing very impatient. Thanks

  2. #2
    Board Regular
    Join Date
    Mar 2002
    Location
    NY
    Posts
    1,056
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Sub Deleter()
    del = InputBox("Text to delete + 4 rows?", , ActiveCell.Value)
    On Error Resume Next
    1:
    Set rw = Columns(1).Find(del, lookat:=xlWhole)
    If Not rw Is Nothing Then
    rw.Resize(5).Delete
    GoTo 1
    End If
    End Sub

  3. #3
    Board Regular
    Join Date
    Feb 2002
    Location
    Los Angeles, CA
    Posts
    752
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Thanks for the help but I made a minor mistake and I don't know if it will effect the macro.

    The word "count" is in column a and the number 1 is in column b.

    Please let me know, thanks.

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
  •