How to save excel file faster with VBA

时间:2015-08-15 07:26:45

标签: excel vba excel-vba save

I have an excel file worth 150 mb and with only one worksheet( master worksheet).As you can imagine it has lots of calculations in it. What I am doing currently is, running a VBA in it to make a new file and copy that worksheet into the new file ( lets say working file) and then deleting some rows from it. For that I am using VBA. the problem is, when I save this file, it takes a lot of time because in the back end , master file (with lots of calculations) is still open. Is there any way , I can save the working file , without getting affected by the big file in the back end. .....Any suggestions would be appreciated...... thanks in Advance

1 个答案:

答案 0 :(得分:0)

我确定计算速度会变慢。尝试使用:

Application.ScreenUpdating = false

在代码的开头和

Application.ScreenUpdating = True 

最后。或者只是在计算和保存时使工作表不可见(visible = false)。尝试微优化字符串操作。如果您能够,请发布一些代码让我们对此发表意见。