Vba stop screen updating intelligence differences dating
However, if you're working with a complex custom application, these easy-to-implement changes should improve efficiency.Hi I am trying to build a VBA modul, two lines with the command (Application.
Admittedly, with today's fast systems, simple macros won't always need optimization.
Most of us use macros to automate processes that we repeat or that require specialized knowledge.
Regardless of why you use macros, you want them to run as quickly as possible.
In this case, it's more efficient to define a variable with the value in I4 and use the variable, as follows: Function Return Fee Fast() Dim int Fee As Integer int Fee = Range("I4").
Value Select Case int Fee Case 1 Return Fee = int Fee * 10 Case 2 Return Fee = int Fee * 20 Case 3 Return Fee = int Fee * 30 Case 4 Return Fee = int Fee * 40 Case 5 Return Fee = int Fee * 50 End Select Msg Box Return Fee, vb OKOnly End Function Please forgive the obnoxiously contrived examples, but the concept is the point, not the code's purpose.