Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
referring to names
Hi all,
I have the following bit of code in Excell 2002 that adds names based on two columns, the first with the reference name and the second the value for the name. Do While Cells(i + 1, 1) < "" ActiveWorkbook.Names.Add Name:=Cells(i + 1, 1), RefersToR1C1:= _ "=InputParameters!R" & i + 1 & "C2" i = i + 1 Loop How would you reference one of the added names in VB? A simple check, such as msgbox name_here, returns a variable not defined error. Thanks, Jason |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
referring to names
msgbox Range("name1").Address & ", " & Range("name1").value
where "name1" represents the name of interest. -- Regards, Tom Ogilvy "TxRaistlin" wrote in message ... Hi all, I have the following bit of code in Excell 2002 that adds names based on two columns, the first with the reference name and the second the value for the name. Do While Cells(i + 1, 1) < "" ActiveWorkbook.Names.Add Name:=Cells(i + 1, 1), RefersToR1C1:= _ "=InputParameters!R" & i + 1 & "C2" i = i + 1 Loop How would you reference one of the added names in VB? A simple check, such as msgbox name_here, returns a variable not defined error. Thanks, Jason |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
referring to names
Thanks! That was exactly what I was looking for.
Jason "Tom Ogilvy" wrote: msgbox Range("name1").Address & ", " & Range("name1").value where "name1" represents the name of interest. -- Regards, Tom Ogilvy "TxRaistlin" wrote in message ... Hi all, I have the following bit of code in Excell 2002 that adds names based on two columns, the first with the reference name and the second the value for the name. Do While Cells(i + 1, 1) < "" ActiveWorkbook.Names.Add Name:=Cells(i + 1, 1), RefersToR1C1:= _ "=InputParameters!R" & i + 1 & "C2" i = i + 1 Loop How would you reference one of the added names in VB? A simple check, such as msgbox name_here, returns a variable not defined error. Thanks, Jason |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
referring to names
Depends upon what is in Cells(I+1,1), but it would be something like
Range("the_Value").Value -- HTH RP (remove nothere from the email address if mailing direct) "TxRaistlin" wrote in message ... Hi all, I have the following bit of code in Excell 2002 that adds names based on two columns, the first with the reference name and the second the value for the name. Do While Cells(i + 1, 1) < "" ActiveWorkbook.Names.Add Name:=Cells(i + 1, 1), RefersToR1C1:= _ "=InputParameters!R" & i + 1 & "C2" i = i + 1 Loop How would you reference one of the added names in VB? A simple check, such as msgbox name_here, returns a variable not defined error. Thanks, Jason |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Referring to Cells | Excel Discussion (Misc queries) | |||
Sumif referring to range names formulas not updating | Excel Worksheet Functions | |||
Referring to a column | Excel Discussion (Misc queries) | |||
Shortcut for referring to tab names in formulas | Excel Worksheet Functions | |||
referring to other worksheet | Excel Worksheet Functions |