Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What is the proper syntax for adding the name "Area1" in
this case, based on a selection of the active cell, xldown. I recorded it but of course it recorded actual R1C1 of the range at the time. That doesn't work since the range will vary in size each time it is run. So, I need to go something like this. ActiveWorkbook.Names.Add Name:="AREA1" _ Range.(Selection, Selection.End(xlDown)) Thanks, Bruce |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Range(Selection, Selection.End(xlDown)).Name = "AREA1"
-- Regards, Tom Ogilvy "Bruce Roberson" wrote in message ... What is the proper syntax for adding the name "Area1" in this case, based on a selection of the active cell, xldown. I recorded it but of course it recorded actual R1C1 of the range at the time. That doesn't work since the range will vary in size each time it is run. So, I need to go something like this. ActiveWorkbook.Names.Add Name:="AREA1" _ Range.(Selection, Selection.End(xlDown)) Thanks, Bruce |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Looks like I tried to make it harder than it was. I
actually kept fiddling with the syntax till I got it to work, but I definitely like your way much better. So I made that change. Thanks, Bruce Roberson -----Original Message----- Range(Selection, Selection.End(xlDown)).Name = "AREA1" -- Regards, Tom Ogilvy "Bruce Roberson" wrote in message ... What is the proper syntax for adding the name "Area1" in this case, based on a selection of the active cell, xldown. I recorded it but of course it recorded actual R1C1 of the range at the time. That doesn't work since the range will vary in size each time it is run. So, I need to go something like this. ActiveWorkbook.Names.Add Name:="AREA1" _ Range.(Selection, Selection.End(xlDown)) Thanks, Bruce . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Deleting a range of rows based on a variable; syntax error | Excel Discussion (Misc queries) | |||
Correct Syntax for Changing Color of Cell Based on Value | Excel Discussion (Misc queries) | |||
Excel 2003 VBA Range selection based on system date | Excel Discussion (Misc queries) | |||
Narrow Range based on Selection in Another Range | Excel Discussion (Misc queries) | |||
Identifying a selection of a selection of a range | Excel Worksheet Functions |