Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Excel VBA > Excel VBA
|
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 4th, 2006, 09:04 AM
Authorized User
 
Join Date: Jul 2006
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
 
Old October 4th, 2006, 12:58 PM
Authorized User
 
Join Date: Mar 2006
Posts: 73
Thanks: 0
Thanked 0 Times in 0 Posts
Default

sure, reference it like this

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

 
Old October 4th, 2006, 01:54 PM
Authorized User
 
Join Date: Jul 2006
Posts: 27
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks much!!!





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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.