I'm trying to use a macro ran from a button press to set the cell name
(label) for a set of cells.
This used to work before but now I'm getting "That name is not valid"
Googling it I don't find anything that really applies to me. The name
I'm trying to set is
r3rsadobe0000161099016701040
in Row 13, Cell 5
Here is the code that performs this.
Worksheets(newEvalArr(i)).Names.Add Name:=evalName,
RefersToR1C1:=cellInR1C1
where evalName is the above text and cellInR1C1 is "=R13C5"
The workbook is not corrupted (to the best of my knowledge) and I have
successfully inserted names around that length before, so I don't know
what's up.
Bob Umlas - 01 Oct 2007 14:17 GMT
It begins with R and a number which Excel is interpreting as a cell
reference. It has nothing to do with VBA -- try to assign that name manually
and you get the same error. Either change the leading r to something else
(not "c"!) or have the 2nd character NOT be a number.
Bob Umlas
Excel MVP
> I'm trying to use a macro ran from a button press to set the cell name
> (label) for a set of cells.
[quoted text clipped - 18 lines]
> successfully inserted names around that length before, so I don't know
> what's up.
Chris - 01 Oct 2007 14:21 GMT
> I'm trying to use a macro ran from a button press to set the cell name
> (label) for a set of cells.
[quoted text clipped - 18 lines]
> successfully inserted names around that length before, so I don't know
> what's up.
Fixed it, I guess it was too early in the morning (or too late at
night) when I was trying to fix this originally..
Adding a preceding underscore "_" fixed the problem
so, instead of
r3rsadobe0000161099016701040
I did
_r3rsadobe0000161099016701040
and it worked perfectly