View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Charles Williams Charles Williams is offline
external usenet poster
 
Posts: 968
Default Excel200: Strange behaviour for Name when referred from VBA

Hi Arvi,

I think ROW() always returns an array because it "returns an array if
entered as a vertical array formula".
And EVALUATE (including the [] syntax) always evaluates formulae as array
formulae whenever it can.

BTW Name Manager evaluates your NAME as 1 col 1 row containing 2

regards
Charles
______________________
Decision Models
The Excel Calculation Site.
www.DecisionModels.com


In my VBA I rever to various names (the ones returning a value) in my
workbook, like:
Var1=[Name1]
It works nicely, except when the name definition contains function ROW()
(maybe there are other behaving similarily - I myself suspect COLUMN()).

The problematic name is something like:
HeaderCnt=ROW(SheetName!$A$2)
(It's needed to adjust automatically formulas and procedures, when some

rows
are added to/removed from table header)
VarHeaderCnt=[HeaderCnt]
returns an 1-dimension object instead of value. To get the value, I have

to
use the code:
VarHeaderCnt=[HeaderCnt]
VarHeaderCnt=VarHeaderCnt(1)