+ Reply to Thread
Results 1 to 11 of 11

VBA Formula Bloats to 100MB file

  1. #1
    Registered User
    Join Date
    01-30-2014
    Location
    Vancouver canada
    MS-Off Ver
    Excel 2013
    Posts
    9

    VBA Formula Bloats to 100MB file

    I have been looking for a formula that would take a Name from a cell and copy that row to the right worksheet. I finally found one that works, but problem is I have a database of 900 names with about 20 divisions so that would be 20 worksheets. The file jumps pretty quick to 50Mb and then stops responding seems the new sheets are the killer. Here is a file Book1.xlsx a sample couple names with actual columns. The other file is what I found that I can use the macro Teachers v2.xlsm

    Any ideas to make this macro work?
    Teachers v2.xlsm
    Book1.xlsx
    Last edited by Leith Ross; 01-31-2014 at 07:15 PM.

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: VBA Formula Bloats to 100MB file

    No I don't see that.

    I created a workbook of 20 sheets and it was only 24kb.

    So your macro must be creating superflous data.

    The attached spreadsheet has a button in cell T1 that will run your macro.

    Enjoy.

    NB: It may pay to delete the redundant data in the new sheets. eg District No. It isn't a major saving I know.
    Attached Files Attached Files
    Last edited by mehmetcik; 01-31-2014 at 09:33 PM.

  3. #3
    Registered User
    Join Date
    01-30-2014
    Location
    Vancouver canada
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: VBA Formula Bloats to 100MB file

    When you add sheets it starts to slow down, now add the row title from the other sheet and slower, then add 500 names to first page and slower, by the time I go from U6C, U8C U10C in new sheet names and the data transfers Excel almost comes to a stop hit U14C and excel stops responding then says resources are all used.

  4. #4
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,522

    Re: VBA Formula Bloats to 100MB file

    Select every sheet in Teachers and click on the End key while holding down the Ctrl key. Do the same with the right arrow key.
    You'll see that you have some kind of formatting in every cell in your sheets. That is 1,048,576 x 16,384 = a whole bunch of cells.
    You can select all the rows below your last entry and delete and do the same for your columns. That should fix that problem.
    I have not checked if the code produces that problem but try the above first.
    Good luck

  5. #5
    Registered User
    Join Date
    01-30-2014
    Location
    Vancouver canada
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: VBA Formula Bloats to 100MB file

    I have already entered my 500 rows in the first sheet, I see what you mean. Maybe I should start again with no data, as I can't highlight thousands of rows to delete Excel pumps out a error.

  6. #6
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,522

    Re: VBA Formula Bloats to 100MB file

    I disabled the code in the This Workbook code window and put the code in it to clean-up.
    See if that does it for you.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,522

    Re: VBA Formula Bloats to 100MB file

    This attachment was, after opening, saved as Teacher.mhtml
    After it was saved, I changed the extension from .mhtml to .xls
    I opened the file with Excel 2007 (Yes at the warning)
    After I saved it again as Teacher.xlsm
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    01-30-2014
    Location
    Vancouver canada
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: VBA Formula Bloats to 100MB file

    Neither the Teachers v3 or v4 work they don't copy data from the master page to the other worksheets with the teachers names.

    Quote Originally Posted by jolivanes View Post
    I disabled the code in the This Workbook code window and put the code in it to clean-up.
    See if that does it for you.

  9. #9
    Registered User
    Join Date
    01-30-2014
    Location
    Vancouver canada
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: VBA Formula Bloats to 100MB file

    I installed XSFormatCleaner.xla and ran the cleaner seems to have helped, so far no crashing. Although the code refreshes every time you go to a worksheet, it would work better and faster if it didn't automatically refresh and look for new data from the master sheet. So like a button that I could press so when I enter new data on the master sheet, that all sheets would be updated. Then when I went to the sheet it would not rescan for new data.

  10. #10
    Registered User
    Join Date
    01-30-2014
    Location
    Vancouver canada
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: VBA Formula Bloats to 100MB file

    So after the format clean I still get a crash. I am dealing with 500 names right now on the master and 19 extra sheets each a different division. When I go through the tabs, by the 6th or so tab I loose resources, and it asks me to debug. Which I just close and open again the file.

  11. #11
    Registered User
    Join Date
    01-30-2014
    Location
    Vancouver canada
    MS-Off Ver
    Excel 2013
    Posts
    9

    Re: VBA Formula Bloats to 100MB file

    So no new ideas. Formula works but if I could have it so the worksheets didn't run the macro everytime I change to view a ne sheet. Like a button that once my data is entered I hit the macro and all sheets get their data from page one and it's done till the next time I add new data to sheet one.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 10-07-2013, 10:55 PM
  2. Formula with File Location Reference Changes When File is Copied
    By snapfade in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 06-09-2013, 08:32 PM
  3. Complex Micro/Formula to Search from one File and Return Value in Another File
    By atthershabbir in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 04-29-2012, 01:31 AM
  4. Replies: 2
    Last Post: 04-16-2011, 09:29 PM
  5. Replies: 1
    Last Post: 01-25-2007, 07:26 AM

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