Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validating range names
I have a program that I am trying to debug. An error occurs when
trying to name a range using a string that "looks" like a cell reference or formula. For example, I can name my range "abc123", but not "ab12". No string beginning with a numeral can be used. Also, "a" works, "b" works, but not "c". Does anyone have a snippet of code that validates strings for use as range names? Thanks! |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validating range names
One way
Dim nme As Name On Error Resume Next Set nme = ActiveWorkbook.Names.Add(Name:="P1", _ RefersTo:="'" & ActiveSheet.Name & "'!A1:A10") On Error GoTo 0 If nme Is Nothing Then MsgBox "Invalid name" End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "procreator" wrote in message oups.com... I have a program that I am trying to debug. An error occurs when trying to name a range using a string that "looks" like a cell reference or formula. For example, I can name my range "abc123", but not "ab12". No string beginning with a numeral can be used. Also, "a" works, "b" works, but not "c". Does anyone have a snippet of code that validates strings for use as range names? Thanks! |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Validating range names
BTW, don't forget ABC123 may be valid in Excel 2003, but it isn't in Excel
2007 with its 16K columns. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "procreator" wrote in message oups.com... I have a program that I am trying to debug. An error occurs when trying to name a range using a string that "looks" like a cell reference or formula. For example, I can name my range "abc123", but not "ab12". No string beginning with a numeral can be used. Also, "a" works, "b" works, but not "c". Does anyone have a snippet of code that validates strings for use as range names? Thanks! |
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 | Excel Programming |