Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 89
Default worksheet collection issue

trying to get a reference to a named range in a different (open) worksheet:

this result in an error (9):
Workbooks("Book1.xls").Worksheets("Sheet1").Range( "RateDesigner")


when i type the final dot after: workbooks("Book1.xls").
i get a drop-down list that includes: worksheets

when i type the final dot after : worksheets().
i get a drop-down list; but, it does not include: range

when i type the final dot after worksheets("Sheet1").
i do not get even a drop-down list


suggestion ?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default worksheet collection issue


I don't see anything wrong with your code so I tested it as follows:

I opened and new wbk (Book1.) and picked any cell and type
RateDesigner in the Name boxEnter

I typed Hello in this cell.

I then opened Book2, opened the VBE, inserted a new module and create
a sub with the following one line:


Activecell
Workbooks("Book1.xls").Worksheets("Sheet1").Range( "RateDesigner")

When I ran the code it returned "Hello" to the activecell a
expected.

So, QUESTIONS: HAVE YOU NAMED THE RANGE IN BOOK1: RateDesigner?

In your code, do you have a range (Activecell or G2 etc) or a variabl
where you want to store the results?

Using a Variable you could say something like:
Dim MyVar as string
MyVar
Workbooks("Book1.xls").Worksheets("Sheet1").Range( "RateDesigner")

The results would then be stored in MyVar for the duration of your su
( or longer if declared as Public

-----------------------------------------------
~~ Message posted from http://www.ExcelTip.com
~~View and post usenet messages directly from http://www.ExcelForum.com

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default worksheet collection issue

Same as this morning.

set rng = Workbooks("Job Nos for Timesheets.xls"). _
Names("RateDesigner").RefersToRange

--
Regards,
Tom Ogilvy

Mark Kubicki wrote in message
...
trying to get a reference to a named range in a different (open)

worksheet:

this result in an error (9):
Workbooks("Book1.xls").Worksheets("Sheet1").Range( "RateDesigner")


when i type the final dot after: workbooks("Book1.xls").
i get a drop-down list that includes: worksheets

when i type the final dot after : worksheets().
i get a drop-down list; but, it does not include: range

when i type the final dot after worksheets("Sheet1").
i do not get even a drop-down list


suggestion ?




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
help with data collection! brandon roland[_2_] New Users to Excel 1 August 8th 07 10:09 PM
Excel Worksheet Password Issue!!!!! nitro Excel Discussion (Misc queries) 2 June 29th 07 10:42 AM
Help with Worksheet issue Scott W Excel Worksheet Functions 4 March 14th 06 08:58 PM
Referencing worksheet issue Keven Jeffery Excel Discussion (Misc queries) 1 December 20th 05 04:58 PM
Is a Collection the best option? Patrick Molloy Excel Programming 0 September 1st 03 10:05 AM


All times are GMT +1. The time now is 11:44 PM.

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"