View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Why is c not a valid name?

You can't use any name that looks like a cell reference.


--
Regards,
Tom Ogilvy



"Bob Phillips" wrote in message
...
Which would suggest that c refers to the column would it not? In the same
way you cannot use r, must be something to do with R1C1.

--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)

"Charlie" wrote in message
...
You're right, I didn't know that. When I select a cell or range on a
worksheet, then ckick in the name reference box and type in "c" Excel

selects
the entire column of the active cell, rather than adds a named range

"c".
Using the Insert-Name-Define menu option gives me that same error

message
you got.

I guess you'll just have to use more descriptive names.

"Gary''s Student" wrote:

I am trying to assign Named Ranges as follows:

Sub Macro2()
Range("A1").Select
ActiveWorkbook.Names.Add Name:="a", RefersToR1C1:="=Sheet2!R1C1"
Range("B1").Select
ActiveWorkbook.Names.Add Name:="b", RefersToR1C1:="=Sheet2!R1C2"
Range("C1").Select
ActiveWorkbook.Names.Add Name:="c", RefersToR1C1:="=Sheet2!R1C3"
End Sub

The last line of code raises a 1004 That name is not valid.


Why?
--
Gary''s Student