using a defined name in a macro
Posted by Elizabeth on August 17, 2000 6:16 PM
In a macro I'm trying to compare the value of a cell to the value of a another cell which I have named. However, the macro is not recognizing the named cell as having a value. Please note that the content of the named cell is text and the named cell is located in a different worksheet in the same file. Is there something I'm missing?
If ActiveCell.Value = Range(name1).Value Then True ...
If ActiveCell.Value = name1 Then True ...
and neither works.
I should say that when I use the same formula within a cell instead of in a macro [=if(a1=name1,true,false)] then everything works just fine.
Can anyone help clear this up?