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.