Adding comments
In this recipe, we will be working with comments. Before we start, you need to understand three important principles about comments:
- VBA code does not depend on comments, meaning that macros will run flawlessly without a single comment.
- At the same time, comments are an important and often-ignored element in code.
- The most important reason why you need to leave comments in code is two-fold.
Comments, or notes, serve as a reminder to yourself. You sometimes create complex sequences for a client, save the file, and move on. When you later see that macro again and need to make adjustments, you will be shocked to realize how little you remember of the thinking process you went through to create that macro.
Comments also serve as an explanation for someone else that might have to amend your coding. Instead of trying to waste time on trying to figure out your thought process, comments make a world of difference for that person.
- Finally, when you record a...