View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default 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