jaimed77089
New Member
- Joined
- Nov 3, 2005
- Messages
- 10
I am trying to decrease the size of a workbook, and I found this code on this forum, can someone tell me where to input this?
Sub ExcelDiet()
Dim x As Integer
Dim LastRow As Long
Dim LastCol As Integer
Application.ScreenUpdating = False
On Error Resume Next
For x = 1 To Sheets.Count
Sheets(x).Activate
LastRow = Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
LastCol = Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Range(Cells(1, LastCol + 1), Cells(65536, 256)).Delete
Range(Cells(LastRow + 1, 1), Cells(65536, 256)).Delete
Next x
On Error GoTo 0
Application.ScreenUpdating = True
End Sub
Sub ExcelDiet()
Dim x As Integer
Dim LastRow As Long
Dim LastCol As Integer
Application.ScreenUpdating = False
On Error Resume Next
For x = 1 To Sheets.Count
Sheets(x).Activate
LastRow = Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious).Row
LastCol = Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious).Column
Range(Cells(1, LastCol + 1), Cells(65536, 256)).Delete
Range(Cells(LastRow + 1, 1), Cells(65536, 256)).Delete
Next x
On Error GoTo 0
Application.ScreenUpdating = True
End Sub