Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Excel VBA Discuss using VBA for Excel programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Excel VBA section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 4th, 2006, 09:04 AM
Authorized User
 
Join Date: Jul 2006
Location: Kalamazoo, MI, USA.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default Referencing Workbook Named Ranges in VBA

Is it possible to reference Named Ranges/Cells in a workbook when in VBA? For instance:

     On worksheet "Monday", I have a cell named EndMiles located at ROW 16, COLUMN 3. In a called VBA sub, I reference that cell by Miles = Worksheets("Monday").Cells(16, 3).Value. I prefer not to use absolute references since any changes to the sheet could invalidate the functionality of the sub. Help?

Terry
Reply With Quote
  #2 (permalink)  
Old October 4th, 2006, 12:58 PM
Authorized User
 
Join Date: Mar 2006
Location: London, , United Kingdom.
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sure, reference it like this

Miles = Worksheets("Monday").Range("EndMiles").value

Reply With Quote
  #3 (permalink)  
Old October 4th, 2006, 01:54 PM
Authorized User
 
Join Date: Jul 2006
Location: Kalamazoo, MI, USA.
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks much!!!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 VBA - Need to open a workbook in a fold bablhous BOOK: Excel 2003 VBA Programmer's Reference 0 December 21st, 2006 02:50 PM
selecting named ranges from an array TheBFJ Excel VBA 1 November 13th, 2006 07:35 AM
HELP! PLEASE referencing named cells sebdanger Excel VBA 6 January 13th, 2005 12:40 AM
Excel Workbook created from Access VBA clueless_may Access VBA 0 June 8th, 2004 09:42 AM



All times are GMT -4. The time now is 06:31 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.