Unsure how my Macros have made my WorkBook over 20MB?

donnabee

New Member
Joined
Jan 30, 2023
Messages
21
Office Version
  1. 365
Platform
  1. Windows
Workbook Here - WARNING it is 20MB plus

I have been (attempting to) clean up my workbook this morning, it is really large and takes a while to open, save and then close.
I found some "solutions" online and tried them (compiling VBA, disabling macros, enabling again, deleting formatting not required etc)
It's not really an option to split the worksheets in the book and create another book.

The workbook takes a while to open, save and close again.

Have I done something weird with the Macros? Do I have things where they should not be?
 
Last edited:

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
If you do a CTRL + End on each sheet where does the cursor go to ??
If it's waaaay down the sheet, you will need to clean the sheets up as they have file bloat.
You cold try running this macro...Save the file..reopen
VBA Code:
Sub MM1()
    Dim x As Long, LastRow As Long, LastCol As Long
    Application.ScreenUpdating = False
    On Error Resume Next
    For x = 1 To Sheets.Count
        With Sheets(x)
            LastRow = .Cells.Find("*", , xlValues, , xlByRows, xlPrevious).Row
            LastCol = .Cells.Find("*", , xlValues, , xlByColumns, xlPrevious).Column
            .Range(.Cells(1, LastCol + 1), .Cells(Rows.Count, Columns.Count)).Delete
            .Range(.Cells(LastRow + 1, 1), .Cells(Rows.Count, Columns.Count)).Delete
        End With
    Next x
    On Error GoTo 0
    Application.ScreenUpdating = True
End Sub
 
Upvote 0
If you do a CTRL + End on each sheet where does the cursor go to ??
If it's waaaay down the sheet, you will need to clean the sheets up as they have file bloat.
You cold try running this macro...Save the file..reopen
VBA Code:
Sub MM1()
    Dim x As Long, LastRow As Long, LastCol As Long
    Application.ScreenUpdating = False
    On Error Resume Next
    For x = 1 To Sheets.Count
        With Sheets(x)
            LastRow = .Cells.Find("*", , xlValues, , xlByRows, xlPrevious).Row
            LastCol = .Cells.Find("*", , xlValues, , xlByColumns, xlPrevious).Column
            .Range(.Cells(1, LastCol + 1), .Cells(Rows.Count, Columns.Count)).Delete
            .Range(.Cells(LastRow + 1, 1), .Cells(Rows.Count, Columns.Count)).Delete
        End With
    Next x
    On Error GoTo 0
    Application.ScreenUpdating = True
End Sub
Thank you so much!!!!
 
Upvote 0
without seeing any of the code, you may be applying formulas, formatting etc, over entire columns and rows, rather than only the areas that need to be affected.
Maybe posting some of the macros would also help.
 
Upvote 0
I can't tell what the Macro you gave me did, it seems about the same regarding time to close and open etc.

I linked the workbook because I have 4 macros and conditional formatting in the workbook.
I'm not sure if I have put the macros in properly, or if I have made other mistakes.
 
Upvote 0
It should have reduced the file size !
Why don't you post the macros on here, and we'll take a look to see if they are causing the bloat.
 
Upvote 0
You have formulas on every sheet that go down to rows 22000.....yet you are only using about 250 rows.
That wouldn't help your processing. You are also using a concat formula in column "N", simply to add a pipe "|".
Why not do a find .jpg and replace with .jpg| in column "M" then column "N" isn't needed.
 
Upvote 0
Solution
Further, delete the "BLANK" sheet, it is using over 1 million rows of formulas. If you need the blank sheet as a reference, reduce it to a couple of rows.
It looks a Mtce management workbook to me.
 
Upvote 0

Forum statistics

Threads
1,215,003
Messages
6,122,655
Members
449,091
Latest member
peppernaut

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