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 March 27th, 2006, 02:26 AM
Registered User
 
Join Date: Jan 2006
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Defining a Dynamic Range using a variable

Can one define a range Name (using Insert > Name > Define) where height of range (i.e., # of rows) is defined by a variable whose value changes in VBA code?
For example, this range my_rng is defined as:
=offset(Sheet1!A1,0,0,xrows,1)

where xrows is a public variable whose value changes frequently.

Of course, the way the name is defined above mandates that xrows is another range already defined in workbook, which is something I am trying to avoid.
Thank you.

Alseikhan






Similar Threads
Thread Thread Starter Forum Replies Last Post
Using month & year variable to get date in range rsearing ASP.NET 2.0 Professional 2 July 5th, 2008 08:30 AM
Copy Paste Dynamic Range jgrant Excel VBA 1 February 5th, 2008 10:13 PM
Combo box can not work with dynamic Range dahlia492 Excel VBA 1 November 20th, 2006 12:43 PM
Create Variable when needed (dynamic) mkhan SQL Server 2000 1 February 22nd, 2006 11:01 PM
Need help to define dynamic range sunny76 Excel VBA 2 June 28th, 2005 11:01 PM





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