Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default 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   Report Post  
Posted to microsoft.public.excel.programming
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Referring to Cells PeterM Excel Discussion (Misc queries) 4 May 30th 08 02:37 PM
Sumif referring to range names formulas not updating Excel_Still_Stumps_ME Excel Worksheet Functions 1 September 19th 06 08:14 PM
Referring to a column Hru48 Excel Discussion (Misc queries) 1 January 31st 06 05:59 PM
Shortcut for referring to tab names in formulas Stilla Excel Worksheet Functions 5 December 6th 05 08:08 PM
referring to other worksheet Geetu M Excel Worksheet Functions 2 March 29th 05 09:37 PM


All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"