Results 1 to 3 of 3

Thread: Deleting Rows

  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Posts
    1,418
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Deleting Rows

    I would like vba that would allow me to detete any row where the cell in column A contains the words "Service Requester" or "Total".Any help would be appreciated.Thanks.

  2. #2
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts
    Does this work?
    Code:
    Sub DeleteSomeRows()
      Dim lRow As Long
      Dim lLastRow As Long
      lLastRow = Cells(Rows.Count, 1).End(xlUp).Row
      For lRow = lLastRow To 1 Step -1
        If Cells(lRow, 1) = "Service Requester" Or _
          Cells(lRow, 1) = "Total" Then Rows(lRow).Delete
      Next
    End Sub
    Steve

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Posts
    1,418
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Thanks Steve.

Posting Permissions

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