Results 1 to 8 of 8

Thread: Shade all Blank rows in Range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    VBAX Wizard lucas's Avatar
    Joined
    Jun 2004
    Location
    Tulsa, Oklahoma
    Posts
    7,321
    Location
    This might not be the best way to do this...uses the used range and looks in column A to see if there is anything there....if not the row gets highlighted:
    Sub test()
        Application.ScreenUpdating = False
        Application.Calculation = xlCalculationManual
        Dim lastrow As Long, r As Long
        lastrow = ActiveSheet.UsedRange.Rows.Count
        For r = lastrow To 2 Step -1
            If UCase(Cells(r, 1).Value) = "" Then
                With Rows(r).Interior
                    .ColorIndex = 6
                    .Pattern = xlSolid
                End With
            End If
        Next r
        Application.Calculation = xlCalculationAutomatic
        Application.ScreenUpdating = True
    End Sub
    Last edited by Aussiebear; 02-05-2025 at 12:25 PM.
    Steve
    "Nearly all men can stand adversity, but if you want to test a man's character, give him power."
    -Abraham Lincoln

Posting Permissions

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