ehmm... what's DYNAMIC about this?
you're just defining a name which points to a STATIC area.
(except that when you define it it takes the size
of first row/first column into account.
without somebody (do you have an eventhandler?)
running that code.. the range will NOT be updated
when the user adds data ..
(and wasn't that the idea of a "Dynamic" named formula?
More important:
... your snippet contains a fatal flaw
it sets a range on the worksheet 'sheetname'
however it's dimensions are decided by the selection
on the ACTIVE sheet...ouch!
keepITcool
< email : keepitcool chello nl (with @ and .)
< homepage:
http://members.chello.nl/keepitcool
Air_Cooled_Nut wrote:
Range("A4").Select 'Set the 'home' cell to where the range starts
(upper left corner of range)
Sheets("sheetname").Range(Range(Selection, Selection.End(xlToRight)),
Selection.End(xlDown)).Name = "ReportingData" 'Select everything to
the right and down & give the range a name
BAM! Here you get a dynamically created range that has a Name you can
use for feeding external reports -- well, it can be used for internal
reports as well but that's not so challenging :-)