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.)
|