Consulting

Results 1 to 4 of 4

Thread: Solved: Change background colour if cell is blank

  1. #1

    Solved: Change background colour if cell is blank

    How do i get the following

    with range a3 to aa & lastrow

    if any cells are blank give them a green background

    ??

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Just use conditional formatting.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    Moderator VBAX Guru Simon Lloyd's Avatar
    Joined
    Sep 2005
    Location
    UK
    Posts
    3,003
    Location
    If you really want a VBA solution:
    [VBA]Sub Blank_Colour()
    Dim Rng As Range
    Set Rng = Range("A3:AA" & Range("AA" & Rows.Count).End(xlUp).Row)
    With Rng.SpecialCells(xlCellTypeBlanks)
    .Interior.ColorIndex = 4
    End With
    End Sub[/VBA]
    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)

  4. #4

    thanks

    Thanks works a treat

Posting Permissions

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