ModifyAppliesToRange question

  • Thread starter Thread starter mikelee101
  • Start date Start date
M

mikelee101

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.Columns(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.
 
Back
Top