Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / October 2007

Tip: Looking for answers? Try searching our database.

"That name is not valid" error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 01 Oct 2007 14:00 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.