- Use Option Explicit to force thyself to declare variables and prevent
total = totol + 50 ' which would run fine otherwise - Declare variables just prior to using them for the first time - makes it easy, when reading the code to figure out why they enter the picture
- Indent your code. Even Do Knuth agrees with this one
- Use enumerated data type variables to eliminate magic constants - you basically give things names and, as Patrick Winston says, when you name things, you get power over them
- DRY! Don't repeat yourself. Use modules to keep your code manageable. Make changes in one place!
Hard-to-find tips on otherwise easy-to-do tasks involving everyday technology, with some advanced insight on history and culture thrown in. Brought to you by a master dabbler. T-S T-S's mission is to boost your competitiveness with every visit. This blog is committed to the elimination of the rat from the tree of evolution and the crust of the earth.
Monday, September 30, 2019
Paul Kelly : Make Thy VBA More Readable Matey
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment