Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range in
Hi All
Hoping someone can point me in the right direction with this? I need to modify the following statment to refer to the CurrentRegion. ActiveWorkbook.Names.Add Name:="Renewal_Report", RefersToR1C1:= _ "=Reports!R5C1:R17C13" as the Current region will change with every entry, the above is not appropriate. Any Idea's? Thanks in Advance Steve |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range in
The following code will work, but only if there is at least one blank row
between regions: Sub NameCurrentRegion() Selection.CurrentRegion.Select Selection.Name = "MyRegion" End Sub -- Kevin Backmann "steve_doc" wrote: Hi All Hoping someone can point me in the right direction with this? I need to modify the following statment to refer to the CurrentRegion. ActiveWorkbook.Names.Add Name:="Renewal_Report", RefersToR1C1:= _ "=Reports!R5C1:R17C13" as the Current region will change with every entry, the above is not appropriate. Any Idea's? Thanks in Advance Steve |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range in
even simpler (no need to select)
Sub NameCurrentRegion() Worksheets("Reports").Range("A5").CurrentRegion = _ "Renewal_Report" End Sub -- Regards, Tom Ogilvy "Kevin B" wrote: The following code will work, but only if there is at least one blank row between regions: Sub NameCurrentRegion() Selection.CurrentRegion.Select Selection.Name = "MyRegion" End Sub -- Kevin Backmann "steve_doc" wrote: Hi All Hoping someone can point me in the right direction with this? I need to modify the following statment to refer to the CurrentRegion. ActiveWorkbook.Names.Add Name:="Renewal_Report", RefersToR1C1:= _ "=Reports!R5C1:R17C13" as the Current region will change with every entry, the above is not appropriate. Any Idea's? Thanks in Advance Steve |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range in
thanks for both replies - both work
"Tom Ogilvy" wrote: even simpler (no need to select) Sub NameCurrentRegion() Worksheets("Reports").Range("A5").CurrentRegion = _ "Renewal_Report" End Sub -- Regards, Tom Ogilvy "Kevin B" wrote: The following code will work, but only if there is at least one blank row between regions: Sub NameCurrentRegion() Selection.CurrentRegion.Select Selection.Name = "MyRegion" End Sub -- Kevin Backmann "steve_doc" wrote: Hi All Hoping someone can point me in the right direction with this? I need to modify the following statment to refer to the CurrentRegion. ActiveWorkbook.Names.Add Name:="Renewal_Report", RefersToR1C1:= _ "=Reports!R5C1:R17C13" as the Current region will change with every entry, the above is not appropriate. Any Idea's? Thanks in Advance Steve |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range in
Tom I think your code should read
Worksheets("Reports").Range("A5").CurrentRegion.Na me = _ "Renewal_Report" But I could be wrong? "steve_doc" wrote: thanks for both replies - both work "Tom Ogilvy" wrote: even simpler (no need to select) Sub NameCurrentRegion() Worksheets("Reports").Range("A5").CurrentRegion = _ "Renewal_Report" End Sub -- Regards, Tom Ogilvy "Kevin B" wrote: The following code will work, but only if there is at least one blank row between regions: Sub NameCurrentRegion() Selection.CurrentRegion.Select Selection.Name = "MyRegion" End Sub -- Kevin Backmann "steve_doc" wrote: Hi All Hoping someone can point me in the right direction with this? I need to modify the following statment to refer to the CurrentRegion. ActiveWorkbook.Names.Add Name:="Renewal_Report", RefersToR1C1:= _ "=Reports!R5C1:R17C13" as the Current region will change with every entry, the above is not appropriate. Any Idea's? Thanks in Advance Steve |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
named range in
Yep - my typo, but looks like you understood. Sorry.
-- Regards, Tom Ogilvy "steve_doc" wrote: Tom I think your code should read Worksheets("Reports").Range("A5").CurrentRegion.Na me = _ "Renewal_Report" But I could be wrong? "steve_doc" wrote: thanks for both replies - both work "Tom Ogilvy" wrote: even simpler (no need to select) Sub NameCurrentRegion() Worksheets("Reports").Range("A5").CurrentRegion = _ "Renewal_Report" End Sub -- Regards, Tom Ogilvy "Kevin B" wrote: The following code will work, but only if there is at least one blank row between regions: Sub NameCurrentRegion() Selection.CurrentRegion.Select Selection.Name = "MyRegion" End Sub -- Kevin Backmann "steve_doc" wrote: Hi All Hoping someone can point me in the right direction with this? I need to modify the following statment to refer to the CurrentRegion. ActiveWorkbook.Names.Add Name:="Renewal_Report", RefersToR1C1:= _ "=Reports!R5C1:R17C13" as the Current region will change with every entry, the above is not appropriate. Any Idea's? Thanks in Advance Steve |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
automatic range - named range give me circular reference... | Excel Discussion (Misc queries) | |||
Array as a "named range" - formula ok in cells, but error as "named range" | Excel Discussion (Misc queries) | |||
inserting a named range into new cells based on a named cell | Excel Discussion (Misc queries) | |||
Compare a selected Range with a Named range and select cells that do not exist | Excel Programming | |||
If any cell in named range = 8 then shade named range | Excel Programming |