how do i minimize/maximize a workbook from vba? I want to minimize it durring processing to speed th

D

Daniel

how do i minimize/maximize a workbook from vba? I want to minimize it
durring processing to speed things up a bit
 
D

Dave Peterson

Record a macro when you do it manually (either the worksheet window or the
application window).

But I never thought that minimizing stuff would make the macro work faster.

But there are some other settings that can make your code work faster:

Application.ScreenUpdating = False
CalcMode = Application.Calculation
Application.Calculation = xlCalculationManual
ActiveSheet.DisplayPageBreaks = False


The first stops the screen flickering when you select different sheets (but it's
even better to not select sheets/ranges/objects).

The second & third line turns calculation to manual (and remembers the current
setting).

You'll want to turn it back to what it was before you started at the end:
Application.calculation = calcmode

And the last tells excel to not worry about where to show those dotted lines
(where page breaks would be). This is useful if your macro inserts/deletes rows
or columns.
 

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