+ Reply to Thread
Results 1 to 9 of 9

Removing macros to make file smaller

  1. #1
    Registered User
    Join Date
    07-12-2012
    Location
    windhoek,namibia
    MS-Off Ver
    2007
    Posts
    5

    Question Removing macros to make file smaller

    I am working on a file with several sheets (around 70). In a previous version of this file, I recorded a macro to export some of the sheets and value the numbers. This made the file size balloon to 54 MB!! Even after deleting the macros it would not make a difference.

    I subsequently redid the file, copying just the data over to sheets in the new file. There are no macros in this new file. I checked the size and it showed as 6.5MB. Awesome. But when I went out of Excel and wanted to send it the size is 15 MB!

    Why does this happen? How can I remove this macro bug that is expanding my file to such a degree?

    Please help!!

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Removing macros to make file smaller

    Here's one explanation and remedy.
    David
    (*) Reputation points appreciated.

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Removing macros to make file smaller

    This generally happens when you are copying and pasting all the cells in a worksheet. Without seeing your code it's difficult to comment, but copy and pasting should be kept to a minimum and excluded altogether wherever possible.

    It is extremely unlikely that a few lines of text (read macro) can balloon your excel file.

  4. #4
    Registered User
    Join Date
    07-12-2012
    Location
    windhoek,namibia
    MS-Off Ver
    2007
    Posts
    5

    Re: Removing macros to make file smaller

    Thanks David! I have downloaded it now, but how do I actually run (use) it in Excel?

  5. #5
    Registered User
    Join Date
    07-12-2012
    Location
    windhoek,namibia
    MS-Off Ver
    2007
    Posts
    5

    Re: Removing macros to make file smaller

    Yup, that is exactly what I have been doing. But certainly it cannot be efficient to retype all formulas and redo all formatting for sheets that contain the same data?

  6. #6
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Removing macros to make file smaller

    If you need to do that, just copy and paste the ranges you need - not ALL the cells in the sheet

  7. #7
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,125

    Re: Removing macros to make file smaller

    Quote Originally Posted by parkingqueen2 View Post
    Thanks David! I have downloaded it now, but how do I actually run (use) it in Excel?
    From the website.
    Note to Excel 2007 Users
    In Excel 2007 the code cleaner can only be run from the VBE Tools menu. There will be no option to run the code cleaner from the new Excel 2007 Ribbon user interface.

  8. #8
    Registered User
    Join Date
    07-12-2012
    Location
    windhoek,namibia
    MS-Off Ver
    2007
    Posts
    5

    Re: Removing macros to make file smaller

    Hi guys,
    Thanks so much for all the input. I have established that it is not the macro, it is actually my rogue copying and pasting. Will try to do it in another way.

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Removing macros to make file smaller

    Glad you got it sorted, thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1