View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default 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