Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Excel macro to name ranges always start in A and end in U

I need a macro that will name ranges that aren't always the same number of
rows, but always start in column A and end in column U.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Excel macro to name ranges always start in A and end in U

Give this a try, and let us know

Set rng = Range(Range("A1"),Cells(Rows.Count,"A").End(xlUp)) .Resize(,21)
rng.Name = "range_name"

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Ocicat" wrote in message
...
I need a macro that will name ranges that aren't always the same number of
rows, but always start in column A and end in column U.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 139
Default Excel macro to name ranges always start in A and end in U

Ocicat:
Other means

ActiveWorkbook.Names.Add Name:="range_name", RefersTo:= _
"=OFFSET($A$1,,,COUNTA($A$1:$A$65536),21)"


--
天行健,君*以自強不息
地勢坤,君*以厚德載物

http://www.vba.com.tw/plog/


"Ocicat" wrote:

I need a macro that will name ranges that aren't always the same number of
rows, but always start in column A and end in column U.

Reply
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
GENERATE RANGES FROM GIVEN NUMBERS(START/END) AND COMPILE INTO ASINGLE LIST. Angela[_2_] Excel Discussion (Misc queries) 7 October 6th 09 01:06 PM
Moving ranges by start date ashleyfox Excel Programming 0 August 22nd 05 11:19 PM
How to start a macro when openning Excel pinguino2005 Excel Programming 4 May 30th 05 01:28 AM
How do I chart date ranges with varying start and finish dates? projectplanner Charts and Charting in Excel 4 May 1st 05 11:36 PM
Help? start macro automatic in excel pim_parra Excel Worksheet Functions 2 April 8th 05 02:03 PM


All times are GMT +1. The time now is 12:34 PM.

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

About Us

"It's about Microsoft Excel"