Forum Discussion
9 quick tips to improve your VBA macro performance
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 https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/option-explicit-statement?f=255&MSPPError=-2147217396 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, 2018Brass Contributor
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.