Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel Macro to Email specified ranges | Excel Discussion (Misc queries) | |||
Macro Ranges | Excel Discussion (Misc queries) | |||
Relative Ranges in excel macro | Excel Discussion (Misc queries) | |||
Relative Ranges in excel macro | Excel Worksheet Functions | |||
vba excel macro question...ranges | Excel Worksheet Functions |