How to reduce excel file size with large data sheet

questforexcel

Board Regular
Joined
Jan 18, 2019
Messages
128
Office Version
  1. 2013
Platform
  1. Windows
Hi All,

I have my main excel file which has about 7-10MB of raw data. When I draw pivots and add formulas to the cells, my file size increases to 22MB.

This makes the file bulky. Is there any way I could reduce the file size as much as possible.

I have tried saving the file type as binary version. That did not help.

THanks,
 

Excel Facts

Whats the difference between CONCAT and CONCATENATE?
The newer CONCAT function can reference a range of cells. =CONCATENATE(A1,A2,A3,A4,A5) becomes =CONCAT(A1:A5)
Run this on a COPY OF YOUR EXISTING WORKBOOK. That way if something goes awry you won't lose anything.

VBA Code:
Sub LipoSuction()
'JBeaucaire (8/3/2009)
Dim LR As Long, LC As Long
Dim ws As Worksheet

For Each ws In Worksheets
    LR = ws.Range("A" & ws.Rows.Count).End(xlUp).Row + 1
    LC = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column + 1

    'Clear everything below column A last cell and row 1 last cell
        ws.Range(ws.Cells(1, LC), ws.Cells(ws.Rows.Count, ws.Columns.Count)).Delete
        ws.Range(ws.Cells(LR, 1), ws.Cells(ws.Rows.Count, ws.Columns.Count)).Delete
Next ws

End Sub
 
Upvote 0
Run this on a COPY OF YOUR EXISTING WORKBOOK. That way if something goes awry you won't lose anything.

VBA Code:
Sub LipoSuction()
'JBeaucaire (8/3/2009)
Dim LR As Long, LC As Long
Dim ws As Worksheet

For Each ws In Worksheets
    LR = ws.Range("A" & ws.Rows.Count).End(xlUp).Row + 1
    LC = ws.Cells(1, ws.Columns.Count).End(xlToLeft).Column + 1

    'Clear everything below column A last cell and row 1 last cell
        ws.Range(ws.Cells(1, LC), ws.Cells(ws.Rows.Count, ws.Columns.Count)).Delete
        ws.Range(ws.Cells(LR, 1), ws.Cells(ws.Rows.Count, ws.Columns.Count)).Delete
Next ws

End Sub
Thanks for sharing. I tried doing this, it only reduced the file size by 100kb. I am missing something? Thanks
 
Upvote 0
No ... nothing missing. The macro has done the best it could with the existing data. Something else is creating the bloat but I don't have anything else to offer
you. Sorry.
 
Upvote 0
You could set the pivots to not save their source data with the file.

Try my suggestion, it will certainly save on the size
Thanks I was trying your suggestion. Just wasnt sure how to apply it. Could you guide me through it.

I have multiple pivots on different sheets of my file. How should I go about not saving their source data. While just want to note that source data is also on the same file.

Thanks,
 
Upvote 0
No ... nothing missing. The macro has done the best it could with the existing data. Something else is creating the bloat but I don't have anything else to offer
you. Sorry.
No worries at all, appreciate you trying to help :)
 
Upvote 0
Select each pivot table in turn and click options. On one of the tabs they're is a checkbox that sets whether the pivot data is saved
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top