View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Color Range of Cells

Simpler formula - =$A5=""

--

HTH

RP

"Dirk Van de moortel" wrote
in message ...

"halem2" wrote in

message
...

Hi folks:

I've been trying to work on some code that would color, let's say 30
consecutive cells on the same row if the firt one is not empty.
Something like...

range("A5").select
if activecell.select < "" then "color the 30 cells on that row to the
right of A5"
activecell.offset (0,1).select
and keep testing until cell is "blank"

Any help would be appreciated.


You don't need code for that.
It can be done with a simple conditional format.
Select the cells you want to give a color depending on cell A5.
Enter conditional format:
"Formula is"
=IF( $A5="", 1, 0 )
and hit the format button to choose a pattern.

Dirk Vdm