The UsedRange continually expands to encompass
the entire area that has ever been used in the
matrix. You can get rid of that bloat by:
- Clearing all in the unwanted range and
also deleting the range -- do BOTH.
- Then save the workbook and it will go away.
Also, you may want to take note of an article
that I recently posted about how to find the
'real last cell'. This explains a lot about
how to deal with the UsedRange issue and
provides an almost bulletproof sample technique
to work around the problem:
http://www.beyondtechnology.com/htm/geeks/geeks012.htm
Very Best Wishes
Rodney Powell
Microsoft MVP - Excel
Beyond Technology Development Corp.
Spring, Texas USA
--------------------------------------------------
Steve Geraghty wrote in article
<01bd037c$2d364000$bc8f79c1@kornet.kornet.nm.kr>...
Is it just me, or does the "UsedRange" property (worksheet) return the
biggest range ever used? What I want, strangely enough, is the current
used range.
If I start with a clean (new) worksheet and put data in say, rows 1-10,
worksheets("Sheet1").UsedRange.Rows.Row returns 10 as I would expect. But,
if I then put something in row 15, delete it (I've used the del key and the
Clear All) the same code returns 15!
Am I doing something terribly wrong? Is there a way to reset the property?
(help shows it as a read-only property)
This is in Excel 5.0
Thanks
--
Steve Geraghty
steven.geraghty@ping.be