Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Naming a range during macro execution
Has anyone found a way of getting a macro to name a selected range that may
be a different selection every time the macro is executed? I'm talking about a relative range name, but the relative button doesn't work for this. The macro always records the name as an absolute reference to the range selected during recording, rather than applying it during execution as a result of actual keystrokes. (Computer users of yesteryear (pre-Windows) will remember like me with both nostalgia and frustration the power that spreadsheets such as Enable and Lotus provided as far back as twenty years ago in being able (among many other gems) to record macros as kesytsrokes, rather than as the results of keystrokes.) |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Naming a range during macro execution
Kevryl
Why use a macro at all...check Debra's site here http://www.contextures.com/xlNames01.html#Dynamic -- HTH Nick Hodge Microsoft MVP - Excel Southampton, England DTHIS www.nickhodge.co.uk "Kevryl" wrote in message ... Has anyone found a way of getting a macro to name a selected range that may be a different selection every time the macro is executed? I'm talking about a relative range name, but the relative button doesn't work for this. The macro always records the name as an absolute reference to the range selected during recording, rather than applying it during execution as a result of actual keystrokes. (Computer users of yesteryear (pre-Windows) will remember like me with both nostalgia and frustration the power that spreadsheets such as Enable and Lotus provided as far back as twenty years ago in being able (among many other gems) to record macros as kesytsrokes, rather than as the results of keystrokes.) |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Naming a range during macro execution
Something along the lines of
iLastRow = Cells(Rows.Count, "A").End(xlUp).Row ActiveWorkbook.Names.Add Name:="myRange", RefersTo:="=Sheet1!R1C1:R" & _ iLastRow & "C1" -- --- HTH Bob (change the xxxx to gmail if mailing direct) "Kevryl" wrote in message ... Has anyone found a way of getting a macro to name a selected range that may be a different selection every time the macro is executed? I'm talking about a relative range name, but the relative button doesn't work for this. The macro always records the name as an absolute reference to the range selected during recording, rather than applying it during execution as a result of actual keystrokes. (Computer users of yesteryear (pre-Windows) will remember like me with both nostalgia and frustration the power that spreadsheets such as Enable and Lotus provided as far back as twenty years ago in being able (among many other gems) to record macros as kesytsrokes, rather than as the results of keystrokes.) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using macro to select a range | Excel Worksheet Functions | |||
macro code to sort a range | Excel Discussion (Misc queries) | |||
checking that cells have a value before the workbook will close | Excel Worksheet Functions | |||
Highlight Range - wrong macro, please edit. | Excel Worksheet Functions | |||
Macro to change Chart Range when inserting a column | Charts and Charting in Excel |