excel "name is not valid" when naming a cell

C

cheesey_toastie

I am programmatically naming cells based on a header row and their
position. The problem is not in code but in a name I am trying to use.

I am trying to name a cell 'C2a.1' and I get 'That Name is not Valid'.

When doing this manually I get the same error. Looking at the help I
know I can't name a cell or range like a valid Excel reference e.g. A2
or $A$2 or R1C2 etc... but this is a mystery to me!

Any ideas?

Steve
 
D

Dave Peterson

Excel doesn't even like names that even look close to an address.

And C2 could be cell C2 (in A1 reference style) or column 2 (in R1C1 reference
style).

Maybe you can just prefix your names with an underscore: _C2a.1

Or something unique that you want to use.
 
B

Bernie Deitrick

Steve,

Many invalid names can become 'valid' if you use a leading undersocre "_" '_C2a.1' will work.
And it should be easy to modify your code to do it...

HTH,
Bernie
MS Excel MVP
 
C

cheesey_toastie

I hate Excels use of names. I am already using things like c2.1 c2.5
its just the c2a.1

I would guess its a bug in the bit of code that validates the name as
it looks close to a R1C1 style formula.

Oh well.. workaround time! Thanks for the underscore suggestion, I
had already done that as a test - it's not ideal as I am actually using
these codes in a third party system.

Thanks for the replies
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top