Forum Discussion
Mark Johnson
Mar 20, 2018Former Employee
9 quick tips to improve your VBA macro performance
As part of our work to help enterprises upgrade to Office 365 ProPlus, we have found that some users have been experiencing slow running VBA, which can be frustrating. The good news is that there are...
Haytham Amairah
Mar 21, 2018Silver Contributor
Hi Mark,
Thank you very much for these valuable tips!
It's noteworthy to mention that the explicitly declare all variables with the appropriate data type increases performance.
You can force yourself to declare all variables by using Option Explicit statement.
In addition, avoid using the Variant data type as much as possible because it will cost the VBA interpreter/compiler some extra steps to determine what the most appropriate data type should be used!
- Mark JohnsonMar 26, 2018Former Employee
Thanks for your feedback, Haytham, it's great to hear more tips that can improve performance. I've updated the post to include information on using Option Explicit to catch issues with undeclared variables.