Dave;
I've added this macro to my collection (even put a button on my
toolbar - I like it!), but I have a question.
This works great if I have deleted rows(columns) but not if I've simply
"Cleared Contents".
I was wondering how Excel distinguishes between an unused cell and one
that was used, but has been cleared?
I thought it may have been something to do with the formatting but I
tried "Clear->All" and it still thinks that the cell is "used".
Not a big deal (perhaps a stupid question) but just wondering.
--
Regards;
Rob
------------------------------------------------------------------------
David McRitchie said:
A macro solution that will reset the used cell range and not force
deletions should you actually have formulas in hidden areas.
Sub Reset_all_lastcells()
'David McRitchie,
http://www.mvps.org/dmcritchie/excel/lastcell.htm
Dim sh As Worksheet, x As Long
For Each sh In ActiveWorkbook.Worksheets
x = sh.UsedRange.Rows.Count 'see J-Walkenbach tip 73
Next sh
End Sub
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages:
http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page:
http://www.mvps.org/dmcritchie/excel/search.htm
<snip>