Dear all,
I've built a macro which task is simply to hide/unhide a few hundred rows in a single worksheet in Excel and hide/unhide 2 out of 4 other worksheets. This takes unfortunately quite some time (about 30 seconds - one minute).
Is there a way to make it run faster? I have used some tips on this and other forums, which improved the running time a bit (especially turning off the Automatic Calculation function) but it is still pretty slow.
I'll put the code below
Thanks in advance!
Kind regards,
Jef
Code
Sub PresentationAxe()
Application.ScreenUpdating = False
Application.EnableEvents = False
ActiveSheet.DisplayPageBreaks = False
'
' PresentationAxe Macro
Application.Calculation = xlManual
'Load waiting message
UFWiP.Show 0
UFWiP.Repaint
Application.ScreenUpdating = False
' presentation code
Rows("31:217").Select
Selection.EntireRow.Hidden = True
Rows("218:403").Select
Selection.EntireRow.Hidden = False
Sheets("Res-ENJEU").Visible = False
Sheets("Res-AXE").Visible = True
Sheets("Budget-ENJEU").Visible = False
Sheets("Budget-AXE").Visible = True
Application.Calculation = xlAutomatic
Unload UFWiP
Application.ScreenUpdating = True
Application.EnableEvents = True
End Sub
Display More