Unfortunately it is more complicated than that
Sub ResetUsedRange()
Dim iLastRow As Long
Dim iLastCol As Long
Dim rng As Range
With ActiveSheet
iLastRow = 0
iLastCol = 0
Set rng = .UsedRange
On Error Resume Next
iLastRow = Cells.Find(What:="*", _
After:=Range("A1"), _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row
iLastCol = Cells.Find(What:="*", _
After:=Range("A1"), _
SearchOrder:=xlByColumns, _
SearchDirection:=xlPrevious).Column
On Error GoTo 0
.Range(.Cells(iLastRow + 1, 1), _
.Cells(.Rows.Count, 1)).EntireRow.Delete
.Range(.Cells(1, iLastCol + 1), _
.Cells(1, .Columns.Count)).EntireColumn.Delete
End With
End Su
--
Bob Phillip
-----------------------------------------------------------------------
Bob Phillips's Profile:
http://www.excelforum.com/member.php...fo&userid=2695
View this thread:
http://www.excelforum.com/showthread.php?threadid=47129