Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default I need an excel macro to name ranges

I have a worksheet on which I have to name multiple ranges for another macro
I have created. The ranges aren't always the same size, however they always
start in column A and end in column U. I have been naming them by hand, but
when there are several hundred ranges, it takes a lot of time.
  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default I need an excel macro to name ranges

here is the code for nameing ranges

ActiveWorkbook.Names.Add Name:="Top50Rpt", RefersTo:= _
Range(Range("A1"),Range("A1").End(xlDown).offset(0 , 3)

This selects a range from A1 to the end of the data in
column A and over 3 Columns. You can change the cell
reference and the offset to fit your ranges.

-----Original Message-----
I have a worksheet on which I have to name multiple

ranges for another macro
I have created. The ranges aren't always the same size,

however they always
start in column A and end in column U. I have been

naming them by hand, but
when there are several hundred ranges, it takes a lot of

time.
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default I need an excel macro to name ranges

or more simply

Range(Range("A1"),Range("A1").End(xlDown).offset(0 , 3)).Name:="Top50Rpt"


--

HTH

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


wrote in message
...
here is the code for nameing ranges

ActiveWorkbook.Names.Add Name:="Top50Rpt", RefersTo:= _
Range(Range("A1"),Range("A1").End(xlDown).offset(0 , 3)

This selects a range from A1 to the end of the data in
column A and over 3 Columns. You can change the cell
reference and the offset to fit your ranges.

-----Original Message-----
I have a worksheet on which I have to name multiple

ranges for another macro
I have created. The ranges aren't always the same size,

however they always
start in column A and end in column U. I have been

naming them by hand, but
when there are several hundred ranges, it takes a lot of

time.
.



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
Excel Macro to Email specified ranges Susan Excel Discussion (Misc queries) 1 June 30th 08 03:51 PM
Macro Ranges Macro Help Excel Discussion (Misc queries) 1 July 18th 07 07:42 AM
Relative Ranges in excel macro edself Excel Discussion (Misc queries) 6 October 13th 05 02:02 PM
Relative Ranges in excel macro edself Excel Worksheet Functions 6 October 13th 05 02:02 PM
vba excel macro question...ranges zoola Excel Worksheet Functions 3 July 6th 05 08:56 PM


All times are GMT +1. The time now is 07:18 AM.

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"