Nanogirl21
Active Member
- Joined
- Nov 19, 2013
- Messages
- 331
- Office Version
- 365
- Platform
- Windows
I have 1 macro that calls several other macros. I am calling instead of running each code separately because I’d like to run everything with the push of 1 button. I have the call set up like this:
When running this macro the time to complete is almost 1 hour + 30 minutes. During this time my computer freezes and becomes very slow. However, if I run each macro 1 by 1 OR run this single call macro by using F8 (step into) the entire process takes no longer than 10 minutes (still a long time, but a whole lot better than 90 minutes).
Any idea on why pne way or running the macros is faster than the other?
Any code that I can add to make things faster?
I have to run this process 3 times a day so having this move faster is very important.
I am using an OptimizeCode_Begin and OptimizeCode_End, but it doesn’t seem to help at all.
Code:
Sub RUN_ALL()
OptimizeCode_Begin
01_IMPORT
02_FIND_DATE
03_ROLE
04_NEW
05_ADD
06_STATUS_FIX
07_LEVEL
08_ FORMATTING
09_E2
10_E2_UPDATES
11_ FORMATTING2
12_LAST
13_HIDE
Save_EXCEL_Files
OptimizeCode_End
Complete_Message
End Sub
When running this macro the time to complete is almost 1 hour + 30 minutes. During this time my computer freezes and becomes very slow. However, if I run each macro 1 by 1 OR run this single call macro by using F8 (step into) the entire process takes no longer than 10 minutes (still a long time, but a whole lot better than 90 minutes).
Any idea on why pne way or running the macros is faster than the other?
Any code that I can add to make things faster?
I have to run this process 3 times a day so having this move faster is very important.
I am using an OptimizeCode_Begin and OptimizeCode_End, but it doesn’t seem to help at all.
Code:
Sub OptimizeCode_Begin()
Application.ScreenUpdating = False
Application.ErrorCheckingOptions.BackgroundChecking = False
EventState = Application.EnableEvents
Application.EnableEvents = False
PageBreakState = ActiveSheet.DisplayPageBreaks
ActiveSheet.DisplayPageBreaks = False
End Sub
Code:
Sub OptimizeCode_End()
ActiveSheet.DisplayPageBreaks = PageBreakState
Application.EnableEvents = EventState
Application.ScreenUpdating = True
Range("A1").Select
End Sub