Sheet outline range.

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
 
D

Dave Peterson

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
 
C

Chris Watts

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
 
C

Chris Watts

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top