clearing excel memory before saving

W

Warren

Excel seems to hold onto its completed macro in the background. then saving
the file increases file size by 4.5 mb.

Can you code in a macro to run, then clear its memory. User can then save
file when ready without increasing the file size. The information only
sorts, no new data is added, but file increase 4.5 mb. You can run the marco
as many times as you like, file size does not continue to grow.

You can exit, reopen and re save and the file decrease by 4.5mb until the
marco is re run.

Many thanks if you can help - going mad trying to work it out

code im using is below

Code

Sheets("Team Data").Select
Range("A5:BK300").Select
Selection.Sort Key1:=Range("A5"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Range("A5").Select
Sheets("Input").Select
Range("C5:GF300").Select
Selection.Sort Key1:=Range("FI5"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top