• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 32. Creating Custom Functions > Documenting Macros and Custom Functions

Documenting Macros and Custom Functions

Even simple macros and custom functions can be difficult to read. You can make them easier to understand by entering explanatory text in the form of comments. You add comments by preceding the explanatory text with an apostrophe. For example, Figure 32-4 shows the Discount function with comments. Adding comments like these makes it easier for you or others to maintain your VBA code as time passes. If you need to make a change to the code in the future, you'll have an easier time understanding what you did originally.

Figure 32-4. The Discount custom function now includes comments.



PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint