LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default Macro to Create Name Ranges for variable lengths of Data

On Jun 16, 1:19*am, GS wrote:
prkhan56 submitted this idea :





On Jun 16, 12:01*am, GS wrote:
Corrections:


* Cell A1="City", Cell B1="Town", Cell C1="State"
* Define A1 as...
* * Name="'Sheet name'!City_Hdr",
* * RefersTo="=$A$1"


* Define the list under "City_Hdr" as...
* * Name="'Sheet name'!City",
* * RefersTo="=OFFSET(City_Hdr,1,0,COUNTA($A:$A)-1,1)


* * Define B1 as...


* * Name="'Sheet name'!City_Hdr",
* * RefersTo="=$B$1"


* Define the list under "Town_Hdr" as...
* * Name="'Sheet name'!Town",
* * RefersTo="=OFFSET(Town_Hdr,1,0,COUNTA($B:$B)-1,1)


* * Define C1 as...


* * Name="'Sheet name'!State_Hdr",
* * RefersTo="=$C$1"


* Define the list under "State_Hdr" as...
* * Name="'Sheet name'!State",
* * RefersTo="=OFFSET(State_Hdr,1,0,COUNTA($C:$C)-1,1)


--
Garry


Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc


Hi Gary,
Thanks for your suggestion.
Claus has provided the code


Ok, but note that Claus's very nice code doesn't make the ranges
dynamic and so it must be run every time new data is added. Debra's
suggestion plus my suggestion results in the ranges automatically
adjusting for data being added or removed.

--
Garry

Free usenet access athttp://www.eternal-september.org
ClassicVB Users Regroup! comp.lang.basic.visual.misc- Hide quoted text -

- Show quoted text -


Hi Gary,
Thanks for your time and suggestion.


 
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
Create List sourced from Multiple sheets of varying lengths desertSol New Users to Excel 1 October 21st 09 10:05 PM
sorting ranges of various column lengths, lookup values in columns mrphinney Excel Worksheet Functions 0 May 14th 09 07:51 PM
Economical grouping of lengths out of much longer lengths Richard (a Builder not a Mathematician) Excel Worksheet Functions 1 January 19th 08 10:28 PM
Counting variable ranges and auto-summing variable ranges Father Guido[_5_] Excel Programming 2 March 29th 06 04:07 AM
Validation List with Variable Lengths & Invisible Empty Cells RobPendulum Excel Programming 3 December 7th 03 01:30 PM


All times are GMT +1. The time now is 01:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"