View Single Post
  #12   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Highlight first blank cell in column

Good point back at me<g, although I think the Row 13 reference in the OP's
original post was for example purposes only. Anyway, it looks like either of
these should always work correctly (unless the column is completely filled
with data)...

Columns("D").SpecialCells(xlCellTypeBlanks)(1).Sel ect

or

Columns("D").Find("", After:=Cells(Rows.Count, "D")).Select

--
Rick (MVP - Excel)


"Jacob Skaria" wrote in message
...
Oops..I didnt notice your response to my post..Try your code with Range
D1:D5
blank...

You could try the below version to handle those scenarios...

Range("D" & IIF(Range("D1")="",1,Range("D1:D13").Find ("").row)).Select

--
Jacob


"Rick Rothstein" wrote:

That will not work if D1 is the empty cell... take a look at the
modification of your statement that I posted Ryan (and also look at the
response I posted to your other message as well).

--
Rick (MVP - Excel)


"Jacob Skaria" wrote in message
...
Try

Range("D1").End(xlDown).Offset(1).Select

--
Jacob


"gotroots" wrote:

Hi

Both solutions have performed there function, only the cell that is
color
highlighted is not "click" hightlighted, if you can understand what I
mean.
Like, if you were to select a cell with the mouse. Like an OnClick
event.



"Jacob Skaria" wrote:

You can avoid looping if D13 is a blank cell (no formula within).

Range("D1").End(xlDown).Offset(1).Interior.ColorIn dex = 3

--
Jacob


"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.


.