• 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.

Macro - File Size of Individual Worksheets

Hi

I have a workbook with about 15 worksheets that is about 15MB

Does anyone have a reliable VBA that would allow me to run and establish the size of each worksheet and this will be summarised on a new tab like

Tab 1 1MB
Tab 2 500k etc

I know it exists but the ones currently on the internet that I have tried does not work.

Regards
 
Hi Sam,

It wouldn't get the report within the file, but this might be the quick and reliable.
Code:
Sub ParseSheets()
Dim ws As Worksheet
Dim fPath As String

'Where to save sheets
fPath = ThisWorkbook.Path

Application.ScreenUpdating = False
For Each ws In ThisWorkbook.Worksheets
    ws.Copy
    Application.DisplayAlerts = False
    ActiveWorkbook.SaveAs fPath & "\COMPARE_" & ws.Name & ".xlsx"
    Application.DisplayAlerts = True
    ActiveWorkbook.Close
Next ws
Application.ScreenUpdating = True
MsgBox "Check out the COMPARE files in folder:" & vbNewLine & fPath
End Sub
Saves each worksheet as a separate file. Saved in same folder as original file, all files have the prefix "COMPARE_" in front of them to make it easy to compare in Windows explorer. Delete the files when done.
 
Back
Top