• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Reduce the file Size

sdsurzh

Member
Hi,


How to reduce the Excel file size.(Suppose from 4MB to 1MB or Even less without deleting the data)


Thanks,

Suresh Kumar S
 
Hi Suresh Kumar,


For starters


Have you got lots of formatting on your spreadsheet?

Have you got lots of blank rows or columns beyond your last data entry?

Try Ctrl+End is that your last data entry? Delete any blank rows or columns and then save the workbook.
 
Hi Suresh Kumar,


If you save the excel file as excel binary workbook (xlsb format) you can reduce the size by half.


Thanks,


Sreekhosh
 
Always

check the durability of the cars before buying them. The range of

distance over which the car can run around depends on the cost,<h2 style="white-space:nowrap;display:inline;font-size:14px;">cheap nfl jerseys</h2>, Torch 9860  The mechanism itself feels robust but the keys do feel a little more crowded than on other models such as the Bold 9900. They can come once a week or once a month. Most companies ensure they hire ethical employees with integrity in order to protect your home and their business name.Most dedicated server hosts provide a web hosting services which are very wide-ranging. Dedicated service providers have their main set up in in huge data centres.


Related articles:

 
Hi Suresh.


While *.xlsb is a good choice. one more option is using this macro without changing your file extension. full detail at http://www.vbaexpress.com/kb/getarticle.php?kb_id=83


==============

[pre]
Code:
Option Explicit 

Sub ExcelDiet() 

Dim j               As Long
Dim k               As Long
Dim LastRow         As Long
Dim LastCol         As Long
Dim ColFormula      As Range
Dim RowFormula      As Range
Dim ColValue        As Range
Dim RowValue        As Range
Dim Shp             As Shape
Dim ws              As Worksheet 

Application.ScreenUpdating = False
Application.DisplayAlerts = False 

On Error Resume Next 

For Each ws In Worksheets
With ws
'Find the last used cell with a formula and value
'Search by Columns and Rows
On Error Resume Next
Set ColFormula = .Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious)
Set ColValue = .Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByColumns, SearchDirection:=xlPrevious)
Set RowFormula = .Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
Set RowValue = .Cells.Find(What:="*", After:=Range("A1"), LookIn:=xlValues, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
On Error Goto 0 

'Determine the last column
If ColFormula Is Nothing Then
LastCol = 0
Else
LastCol = ColFormula.Column
End If
If Not ColValue Is Nothing Then
LastCol = Application.WorksheetFunction.Max(LastCol, ColValue.Column)
End If 

'Determine the last row
If RowFormula Is Nothing Then
LastRow = 0
Else
LastRow = RowFormula.Row
End If
If Not RowValue Is Nothing Then
LastRow = Application.WorksheetFunction.Max(LastRow, RowValue.Row)
End If 

'Determine if any shapes are beyond the last row and last column
For Each Shp In .Shapes
j = 0
k = 0
On Error Resume Next
j = Shp.TopLeftCell.Row
k = Shp.TopLeftCell.Column
On Error Goto 0
If j > 0 And k > 0 Then
Do Until .Cells(j, k).Top > Shp.Top + Shp.Height
j = j + 1
Loop
If j > LastRow Then
LastRow = j
End If
Do Until .Cells(j, k).Left > Shp.Left + Shp.Width
k = k + 1
Loop
If k > LastCol Then
LastCol = k
End If
End If
Next 

.Range(Cells(1, LastCol + 1).Address & ":IV65536").Delete
.Range(Cells(LastRow + 1, 1).Address & ":IV65536").Delete
End With
Next 

Application.ScreenUpdating = True
Application.DisplayAlerts = True 

End Sub
[/pre]

=====================================
 
Back
Top