ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Why cannot name a function A1 or NA77? (https://www.excelbanter.com/excel-programming/433603-why-cannot-name-function-a1-na77.html)

vsoler

Why cannot name a function A1 or NA77?
 
Why cannot name a function A1 or NA77?

Then a call to these functions is unable to find their definitions and
a #REF! is returned.

What's the problem?

joel

Why cannot name a function A1 or NA77?
 
Excel thinks the names are cell addresses.

"vsoler" wrote:

Why cannot name a function A1 or NA77?

Then a call to these functions is unable to find their definitions and
a #REF! is returned.

What's the problem?


Dave Peterson

Why cannot name a function A1 or NA77?
 
It looks like an address when you're in A1 reference style.



vsoler wrote:

Why cannot name a function A1 or NA77?

Then a call to these functions is unable to find their definitions and
a #REF! is returned.

What's the problem?


--

Dave Peterson

vsoler

Why cannot name a function A1 or NA77?
 
On Sep 15, 12:29*am, Dave Peterson wrote:
It looks like an address when you're in A1 reference style.

vsoler wrote:

Why cannot name a function A1 or NA77?


Then a call to these functions is unable to find their definitions and
a #REF! is returned.


What's the problem?


--

Dave Peterson


Very clear!

Chip Pearson

Why cannot name a function A1 or NA77?
 
Just as a side note, Excel 2007 has 16,384 columns, versus 256 in
earlier version, so what were in 2003 and earlier valid function names
and defined names are no long valid as names in 2007. E.g,. In 2003,
you could have a function like

Function NA77(D As Double) As Double
NA77 = D * 100
End Function

This would work because in 2003, NA77 is not a valid cell address and
is thus legal as a function name. Bring that workbook into Excel 2007
and NA77 is a valid cell address, so the function won't be called and
you'll get errors.

Similarly, in 2003, NA77 could be used as a defined name since it was
not a valid cell address. If you bring that into 2007, Excel will ask
to change the defined name to _NA77 but won't attempt to change any
VBA code. Thus, you could get errors or unexpected results.

The summary, then, is to use longer names for functions and defined
names so you won't have problems when moving to 2007 and beyond.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 14 Sep 2009 14:14:57 -0700 (PDT), vsoler
wrote:

Why cannot name a function A1 or NA77?

Then a call to these functions is unable to find their definitions and
a #REF! is returned.

What's the problem?


Barb Reinhardt

Why cannot name a function A1 or NA77?
 
Excel 2007 didn't like my named ranges POP1, POP2, POP3 for this very reason.
What a PITA to change 'em all.

"Chip Pearson" wrote:

Just as a side note, Excel 2007 has 16,384 columns, versus 256 in
earlier version, so what were in 2003 and earlier valid function names
and defined names are no long valid as names in 2007. E.g,. In 2003,
you could have a function like

Function NA77(D As Double) As Double
NA77 = D * 100
End Function

This would work because in 2003, NA77 is not a valid cell address and
is thus legal as a function name. Bring that workbook into Excel 2007
and NA77 is a valid cell address, so the function won't be called and
you'll get errors.

Similarly, in 2003, NA77 could be used as a defined name since it was
not a valid cell address. If you bring that into 2007, Excel will ask
to change the defined name to _NA77 but won't attempt to change any
VBA code. Thus, you could get errors or unexpected results.

The summary, then, is to use longer names for functions and defined
names so you won't have problems when moving to 2007 and beyond.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)


On Mon, 14 Sep 2009 14:14:57 -0700 (PDT), vsoler
wrote:

Why cannot name a function A1 or NA77?

Then a call to these functions is unable to find their definitions and
a #REF! is returned.

What's the problem?




All times are GMT +1. The time now is 04:47 AM.

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