简体   繁体   中英

Excel Workbook growing in size by running the same VBA

I run VBA code on a weekly basis. The code opens a set of data, manipulates it and and pastes into another file.

In summary:

  • Execute from a master file
  • Open a CVS file and convert it to Excel columns
  • Delete previous data and paste the above into the master file
  • Apply some formulas (V-lookups to map the data)
  • Apply filter to select a sub set needed and copy it
  • Open another workbook and paste selected data

The master file does not store historical data and handles the same amount of data every time, about 5k rows.

Originally the workbook had about 2MB, nothing has changed, I have run the same macro for over one year. I just noticed it is taking a long time to open the master workbook and the size is 91MB.

I think it's because of metadata. You could create a new sheet and work there after you finish all your work and after closing the macro delete the sheet you have being working on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM