Results 1 to 8 of 8

Thread: Shade all Blank rows in Range

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #5
    Site Admin VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,008
    Location
    Here's another way:
     
    Sub Macro1()
        Dim Rng, MyCell As Range
        Dim lRow As Long
        lRow = ActiveSheet.UsedRange.Rows.Count
        lCol = ActiveSheet.UsedRange.Columns.Count
        Set Rng = Range(Cells(1, 1), Cells(lRow, lCol))
        For Each MyCell In Rng
            If MyCell = "" Then
                MyCell.EntireRow.Interior.ColorIndex = 15
            End If
        Next MyCell
    End Sub
    Regards,
    Simon
    Last edited by Aussiebear; 02-05-2025 at 12:26 PM.
    Regards,
    Simon
    Please read this before cross posting!
    In the unlikely event you didn't get your answer here try Microsoft Office Discussion @ The Code Cage
    If I have seen further it is by standing on the shoulders of giants.
    Isaac Newton, Letter to Robert Hooke, February 5, 1675 English mathematician & physicist (1642 - 1727)

Posting Permissions

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