Sheet outline range.

  • Thread starter Thread starter Chris Watts
  • Start date Start date
C

Chris Watts

How can I determine in vba the range occupied by a sheet?
The edges of the sheet may be "ragged" ie. there will be blank cells within
the range and at its edges - I want to determine the overall rectangular
occupied outline to use in a Range statement.

TIA
Chris
 
Depending on what you want, you may want to try .usedrange.

msgbox worksheets("Sheet1").usedrange.addresss
(for example)

Be aware that excel keeps track of the usedrange in a way you probably don't--it
remembers the last used cell, even if you've cleared that cell.

Debra Dalgleish shares some techniques for resetting the usedrange:
http://contextures.com/xlfaqApp.html#Unused
 
Thanks Dave, I'll give that a try.
Chris

Dave Peterson said:
Depending on what you want, you may want to try .usedrange.

msgbox worksheets("Sheet1").usedrange.addresss
(for example)

Be aware that excel keeps track of the usedrange in a way you probably
don't--it
remembers the last used cell, even if you've cleared that cell.

Debra Dalgleish shares some techniques for resetting the usedrange:
http://contextures.com/xlfaqApp.html#Unused
 
This is just a repost of my query and Dave's reply to this group. So how
will that help me? ..and you have done it with another of my queries as
well.
Guess that you should be on my kill-file.

Chris
 
Back
Top