Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default The XLS file is huge!

Hi Niklas

Excel can think that the usedrange is bigger then it is.

You can see how big your usedrange is on every sheet with CTRL-END
If the row/column is not the last row/column with data then:

1 Select the first row below your last row with data
2 CTRL-SHIFT-DOWN ARROW
3 Right click on the selection and choose delete

And then for the columns

1 Select the first column next to your last column with data
2 CTRL-SHIFT-RIGHT ARROW
3 Right click on the selection and choose delete

Save the file an close it


Don't save the file in two versions but only as Microsoft excel workbook
Not as 97-2002 & 5.0/95 workbook(this make your workbook big)

You can use Rob Bovey's Code cleaner to clean up your code
http://www.appspro.com/utilities/utilities.asp


Or use a Macrofrom Debra Dalgleish her site


Sub DeleteUnused()
Dim myLastRow As Long
Dim myLastCol As Long
Dim wks As Worksheet
Dim dummyRng As Range

For Each wks In ActiveWorkbook.Worksheets
With wks
Set dummyRng = .UsedRange
On Error Resume Next
myLastRow = _
.Cells.Find("*", after:=.Cells(1), _
LookIn:=xlFormulas, lookat:=xlWhole, _
searchdirection:=xlPrevious, _
searchorder:=xlByRows).Row
myLastCol = _
.Cells.Find("*", after:=.Cells(1), _
LookIn:=xlFormulas, lookat:=xlWhole, _
searchdirection:=xlPrevious, _
searchorder:=xlByColumns).Column
On Error GoTo 0

If myLastRow * myLastCol = 0 Then
.Columns.Delete
Else
.Range(.Cells(myLastRow + 1, 1), _
.Cells(.Rows.Count, 1)).EntireRow.Delete
.Range(.Cells(1, myLastCol + 1), _
.Cells(1, .Columns.Count)).EntireColumn.Delete
End If
End With
Next wks
End Sub



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Niklas" wrote in message ...
Hi
My XLS file consists of 20 sheets with between 10 and 150
rows and no more than 12 columns. On the sheets their are
some buttons, ckeckboxes and comboboxes. This file is 12
MB and it is to big. Are their any "Tips and tricks" to
make it smaller?
Are their any compress/shrink file methods like in Access?
Regards
/Niklas



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Huge File. Dan Excel Discussion (Misc queries) 2 September 16th 08 07:42 AM
i need to import a huge txt file into excel Adelne Excel Discussion (Misc queries) 3 January 29th 07 02:11 AM
Huge file import is truncated Jo Excel Discussion (Misc queries) 4 July 19th 06 07:30 PM
huge huge excel file... why? Josh Excel Discussion (Misc queries) 12 February 9th 06 09:55 PM
File got huge BW Excel Discussion (Misc queries) 2 January 11th 05 01:57 AM


All times are GMT +1. The time now is 01:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"