Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Refer to a named range in a seperate workbook

Hi All,

I would appreciate some help with the following:

I have created an add in which displays a userform. Part of the
routine involves a look up to a named range called “currency” on a
worksheet called “rates”. The problem is that since the named range is
not in the active workbook the look up formula returns an error.

Any idea on how to refer to a named range contained within the add-in
and not in the active workbook.

Thanks,

Steve
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,049
Default Refer to a named range in a seperate workbook

ThisWorkbook refers to the workbook hosting (ie running) the code. Sine the
range requested is from the addin, use

set thisrange = ThisWorkboook.Worksheets("Rates").Range("currency" )
'where thisrange is defined as a range object
or

ccy = ThisWorkboook.Worksheets("Rates").Range("currency" ).Value
'where ccy could be string or double depending on the data in the cell



"sgltaylor" wrote in message
...
Hi All,

I would appreciate some help with the following:

I have created an add in which displays a userform. Part of the
routine involves a look up to a named range called “currency” on a
worksheet called “rates”. The problem is that since the named range is
not in the active workbook the look up formula returns an error.

Any idea on how to refer to a named range contained within the add-in
and not in the active workbook.

Thanks,

Steve


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Refer to a named range in a seperate workbook

On Dec 18, 8:52*pm, sgltaylor wrote:
Hi All,

I would appreciate some help with the following:

I have created an add in which displays a userform. Part of the
routine involves a look up to a named range called “currency” on a
worksheet called “rates”. The problem is that since the named range is
not in the active workbook the look up formula returns an error.

Any idea on how to refer to a named range contained within the add-in
and not in the active workbook.

Thanks,

Steve


Hi Patrick,

Thanks for the suggestion. However, I keep getting an object required
error.
Any idea on what I am doing wrong?

Thanks,

Steve
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
Refer to a named range Dave Excel Programming 9 December 4th 09 03:00 PM
Refer to a named range indirectly tberkom Excel Worksheet Functions 1 May 13th 09 12:33 AM
refer to a named range in this.workbook michael.beckinsale Excel Programming 10 May 14th 08 01:39 PM
How does one refer to the n-1 element of a named range? Charles Hewitt Excel Discussion (Misc queries) 2 November 26th 05 06:56 AM
Refer to seperate workbook for validation list for drop downs? Dee Excel Discussion (Misc queries) 2 March 4th 05 07:50 PM


All times are GMT +1. The time now is 08:14 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"