Useful URLs For Creating VBA Code
There are a multitude of online resources to help you develop your Visual Basic for Applications (VBA) skills. Here are a few core links, referenced in Beezix’s VBA 2016 Introduction quick reference guide, that will enhance any VBA project you take on.
Good Practices with Variables
Variables are a great VBA tool routinely used within any VBA project. It is good practice to prefix the variable’s name with a common abbreviation of the variable’s type to indicate its function. For example, you can quickly discern that the variable strMsg contains text because the “str” prefix indicates it was created as a String or text type. A complete list of appropriate variable prefixes can be found at:
http://en.wikipedia.org/wiki/Leszynski_naming_convention
There are 17 data types to choose from when declaring a new variable. The complete list can be found at:
https://msdn.microsoft.com/en-us/vba/language-reference-vba/articles/data-type-summary
Reach Out to Users
The VBA MsgBox function is a great way to give your users appropriate control over code decisions and keep them updated on what code is doing. Part of good VBA design is to use a MsgBox button/icon combination that sets the right tone for your message. Investigate the complete list of MsgBox buttons and icons at:
http://msdn.microsoft.com/en-us/library/office/gg251821(v=office.15).aspx
Sophistication with VBA Functions
Functions are the lifeblood of VBA projects. They help manipulate data or assist code execution. If you are an Excel user, however, you may become ensnared by subtle differences with similar Excel functions. An excellent online resource lists all VBA functions together with descriptions and examples. This list can be found at:
http://msdn.microsoft.com/en-us/library/office/jj692811(v=office.15).aspx
A list only of VBA conversion functions can be found at:
http://msdn.microsoft.com/en-us/library/office/gg264670(v=office.15).aspx
VBA Format functions have a great variety of formatting possibilities which are detailed at:
http://msdn.microsoft.com/en-us/library/office/gg251755(v=office.15).aspx
Troubleshooting
A helpful list of VBA error messages can be found at (click the “+” to the left of the In This Section subheading):
http://msdn.microsoft.com/enus/library/jj692802(v=office.15).aspx