Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Referencing a named range in another workbook

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nigel RS - 23 Jan 2008 01:48 GMT
Simple one - I think!

My main application (Excel Workbook) opens another workbook with named
range(single cell). How can I refer to these named ranges and return the
value.
In the following code I am trying to set the sheet shControl (codename)
range A1 to the value in the dataWb named range "OptRef"

Dim dataWb as Workbook
Set dataWb = Workbooks.Open(myfile)
With dataWb.Sheets("Sheet1")
  shcontrol.range("A1") = ????
End With

TIA
Jim Cone - 23 Jan 2008 04:28 GMT
shcontrol.range("A1").Value = .Range("OptRef").Value
Signature

Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)

"Nigel RS"
wrote in message
Simple one - I think!

My main application (Excel Workbook) opens another workbook with named
range(single cell). How can I refer to these named ranges and return the
value.
In the following code I am trying to set the sheet shControl (codename)
range A1 to the value in the dataWb named range "OptRef"

Dim dataWb as Workbook
Set dataWb = Workbooks.Open(myfile)
With dataWb.Sheets("Sheet1")
  shcontrol.range("A1") = ????
End With

TIA

Nigel - 23 Jan 2008 07:09 GMT
Thanks Jim, I got tangled up in using the workbook Names collection and lost
sight of the Range !

Signature

Regards,
Nigel
nigelnospam@9sw.co.uk

> shcontrol.range("A1").Value = .Range("OptRef").Value
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.