View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default Highlight first blank cell in column

This should help! This code will start at the top of Column D and scan down
to find the first empty cell and the highlight that cell yellow, then exit.
Let me know if I need to tweak it for you. Hope this helps! If so, let me
know, click "YES" below.

Sub Highlighter()

Dim lngLastRow As Long
Dim rng As Range

lngLastRow = Cells(Rows.Count, "D").End(xlUp).Row

For Each rng In Range("D1:D" & lngLastRow)
If IsEmpty(rng) Then
rng.Interior.ColorIndex = 6
Exit For
End If
Next rng

End Sub
--
Cheers,
Ryan


"gotroots" wrote:

What code do I need to allow the first blank cell found in a range to be
highlighted.

Example

D1:D12 contains a value
D13 is the first blank cell in "D"

C5 is hightlighted

when code is run D13 is highlighted

Thank you if you can help with this.