View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
mikelee101 mikelee101 is offline
external usenet poster
 
Posts: 36
Default ModifyAppliesToRange question

Hello,
Does anyone know why this works:
---------------
Dim Cond As FormatCondition
<snip
Cond.ModifyAppliesToRange (ThisWorkbook.Names("cond.table") _
.RefersToRange.Columns(1).Cells)
<snip
---------------
While this doesn't:
---------------
Dim Cond As FormatCondition, Rng as Range
<snip
Set Rng = ThisWorkbook.Names("cond.table").RefersToRange.Col umns(1).Cells

Cond.ModifyAppliesToRange (Rng)
<snip
----------------
I get an "Object Required" error. I've also tried Rng.Cells, Rng.Address
and Rng.Cells.Address and all that did was change whether I got the error in
runtime or at compile.

There's (obviously) more to the code than this, and being able to use a
variable would be helpful. Any thoughts that anyone might have would be
greatly appreciated.

Thanks.
--
Mike Lee
McKinney,TX USA