ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   defrag an excel file (https://www.excelbanter.com/excel-discussion-misc-queries/163745-defrag-excel-file.html)

BobHankinson

defrag an excel file
 
I have an Excel 2003 workbook in which I created a lot of pivot tables, all
of which I have deleted. There must be some data hidden because the file has
grown to 2.5MB and is very slow to navigate. How can I delete the hidden
tables?

joel

defrag an excel file
 
It is probably better to copy the worksheets to a new wrokbook. sometimes a
workbook gets corrupted and the only solution is to move the sheets to a new
workbook.

the macro below will automatically create a new workbook and move the
worksheets. charts will not be moved and if there are references between
worksheets they probably won't get updated. You may need to update links by
going to worksheet menu Edit - Links to get the links updated.


Sub movetonew()

Workbooks.Add
Set NewWbk = ActiveWorkbook
For Each wbk In ThisWorkbook.Worksheets
wbk.Copy after:=NewWbk.Sheets(NewWbk.Worksheets.Count)
Next wbk
End Sub


"BobHankinson" wrote:

I have an Excel 2003 workbook in which I created a lot of pivot tables, all
of which I have deleted. There must be some data hidden because the file has
grown to 2.5MB and is very slow to navigate. How can I delete the hidden
tables?



All times are GMT +1. The time now is 06:27 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com