Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 55
Default refering to a named range on a different worksheet

I have code that refers to a named range:

Dim name1, name2, varRange, c, rowCount
name2 = ActiveWorkbook.Names("Range")
rowCount = ActiveSheet.Range(name2).Value 'Original

"Range" is a named range on Sheet2

If sheet 2 is active when I run the code the value of "Range" loads
correctly.

However, I need this to work when I have sheet1 active. Trying this I
get "Application-defined or object-defined error" probably because
of the "activesheet" object...

I tried: rowCount = ActiveWorkbook.Range(name2).Value
and get "Object doesn't support this property or method (Error
438)"

Clearly Im missing something here, any help will be appreciated.

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
Can you name a worksheet by refering to a cell reference or range o2bing Excel Discussion (Misc queries) 10 March 21st 08 07:18 AM
Do not specify worksheet in a named range hmm Excel Discussion (Misc queries) 3 September 18th 07 01:30 PM
Refering to a named range in a chart: 2007 fruitticher Excel Worksheet Functions 1 September 14th 07 06:52 PM
Getting a named range to appear in another worksheet John Excel Discussion (Misc queries) 2 July 28th 07 02:12 AM
help in refering to a range named in a cell jf Excel Programming 1 January 20th 05 02:44 PM


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