Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Mar 2006
    Posts
    76
    Thanks
    6
    Thanked 0 Times in 0 Posts

    delete unwanted rows multiple tabs

    I have another request, in trying to clean up my tabs, I need to delete the full row, in any row below Row 9, where there is no data in Column G. Again leaving sheet 1 & 2 separated out from from the deletions. What code would you suggest?

  2. #2
    2 Star Lounger
    Join Date
    Aug 2011
    Posts
    112
    Thanks
    35
    Thanked 3 Times in 3 Posts
    Try...

    Based on LR column B

    Code:
    Sub Delete_Row_G()
        Dim LR As Long
        Dim ws As Worksheet
        Dim i As Long
        Application.ScreenUpdating = False
        For Each ws In ActiveWorkbook.Worksheets
            If Not ws.Name = "Sheet1" And Not ws.Name = "Sheet2" Then
                With ws
                    LR = .Range("B" & .Rows.Count).End(xlUp).Row
                    For i = LR To 9 Step -1
                        If .Range("G" & i).Value = "" Then .Rows(i).EntireRow.Delete
                    Next i
                End With
            End If
        Next ws
        Application.ScreenUpdating = True
    End Sub

  3. #3
    Star Lounger
    Join Date
    Mar 2006
    Posts
    76
    Thanks
    6
    Thanked 0 Times in 0 Posts
    Thanks... You are teaching me how to read the code, I combined this code above with the previous code you supplied and it worked great...Thanks!!

  4. #4
    2 Star Lounger
    Join Date
    Aug 2011
    Posts
    112
    Thanks
    35
    Thanked 3 Times in 3 Posts
    Thanks... You are teaching me how to read the code
    That is great to hear. Glad you have some working solutions and happy to help.

Posting Permissions

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