ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ModifyAppliesToRange question (https://www.excelbanter.com/excel-programming/432516-modifyappliestorange-question.html)

mikelee101

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


All times are GMT +1. The time now is 02:35 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com