Join Curt Frye for an in-depth discussion in this video Adding comments to the code, part of Learning VBA in Excel.
It takes even the most skilled VBA programmer some time to examine an unfamiliar…workbook's code and learn how it operates.…Whether you're viewing a new workbook or one that you created some time ago,…you'll find that adding comments to the code helps you understand its…operation much more quickly.…To add a comment, just open a code module, type a single quotation mark and then…type in your comment.…So in this case, it could be "Calculates 9% sales tax."…And when you press Enter or move off that line using an arrow key, Excel…highlights that code in green, indicating that it's a comment.…
You can also add a comment at the end of a line of code by typing a single quote…and then typing the comment.…So, for example, if I wanted to just say 'That's 9%, and move off the line…pressing the down arrow key, then everything to the right of the quotation mark…is considered to be a comment.…After you type a single quotation mark, everything to its right is treated as a comment.…So, for example, you can't type another single quotation mark and put in more code;…
- Working in the Visual Basic Editor
- Adding code to a macro
- Creating, exporting, and deleting code modules
- Declaring and using variables
- Managing variable scope
- Defining arrays
- Managing workbooks and worksheets with VBA
- Repeating tasks with loops
- Debugging VBA code
- Cutting, copying, and pasting cell data
- Running and triggering event procedures
Skill Level Advanced
Excel 2010: Tips, Tricks, and Shortcutswith Dennis Taylor3h 43m Intermediate
1. Introducing Visual Basic for Applications (VBA)
2. Defining Variables, Constants, and Calculations
3. Adding Logic to Your VBA Code
4. Debugging Your VBA Code
5. Managing Workbook Elements and Data in VBA
6. Adding Advanced Elements to Your Workbook
7. Using Excel Events in Your VBA Code
8. Putting It All Together
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.