Using parts of the code I posted in the mini-blog article I referred you to, this single (albeit long) line of code will do what you asked for...
Code:Range("A1:" & Cells(Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row, _ Cells.Find(What:="*", SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, LookIn:=xlFormulas).Column).Address).Select
thank you rick! how do i now name the range?
Selection.Name = "TheNameYouWantToGiveThisRange"
Range("A1:" & Cells(Cells.Find(What:="*", SearchOrder:=xlRows, _
SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row, _
Cells.Find(What:="*", SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious, LookIn:=xlFormulas).Column).Address).Name = "TheNameYouWantToGiveThisRange
excellent. Thank you sir.Once you have selected the range, you can execute this line of code to name that selection...
However, if that is your ultimate goal (only to name the range), then you do not need to select the range first as you can name it directly (very seldom is it necessary to select a range before you do something with it).Code:Selection.Name = "TheNameYouWantToGiveThisRange"
Code:Range("A1:" & Cells(Cells.Find(What:="*", SearchOrder:=xlRows, _ SearchDirection:=xlPrevious, LookIn:=xlFormulas).Row, _ Cells.Find(What:="*", SearchOrder:=xlByColumns, _ SearchDirection:=xlPrevious, LookIn:=xlFormulas).Column).Address).Name = "TheNameYouWantToGiveThisRange