Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
range names
Hi
y does the code...... selection.name=range("A1").text return an error.... "this name is not valid" please help!!!!!!!!!!!! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
range names
Because - the name is not valid. As an experiment I created a
spreadsheet with the text "Bob" in A1 then wrote a sub with your line of code and it executed with no problem at all - so the problem must lie with the actual text in A1. I think that the rules are that it shouldn't have anything other than letters, underscores and numbers, shouldn't be confusable with a cell address and shouldn't start with a number. What do you have in A1? Zaahir wrote: Hi y does the code...... selection.name=range("A1").text return an error.... "this name is not valid" please help!!!!!!!!!!!! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
range names
One more thought - note that when you use Insert - Names - Create to
create a name, Excel automatically replaces spaces with underscores. You can do this in VBA: Selection.Name = Replace(Trim(Range("A1").Text), " ", "_") HTH -John Coleman John Coleman wrote: Because - the name is not valid. As an experiment I created a spreadsheet with the text "Bob" in A1 then wrote a sub with your line of code and it executed with no problem at all - so the problem must lie with the actual text in A1. I think that the rules are that it shouldn't have anything other than letters, underscores and numbers, shouldn't be confusable with a cell address and shouldn't start with a number. What do you have in A1? Zaahir wrote: Hi y does the code...... selection.name=range("A1").text return an error.... "this name is not valid" please help!!!!!!!!!!!! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
converting email address names in a range of cells to real names | Excel Worksheet Functions | |||
How to Delete blanks between a range and populate only the names inthe given range | Excel Discussion (Misc queries) | |||
COPYING FORMULA CONTAINING NAMES/RELATIVE RANGE NAMES | Excel Discussion (Misc queries) | |||
Selecting range in list of range names depending on a cell informa | Excel Discussion (Misc queries) | |||
Range Names-VBA | Excel Programming |