Select Page

There are three very useful shortcuts in Excel Video 420. I’ll show you how to quickly comment and uncomment lines of code. For those of you who don’t write a lot of code, by comment I mean to have VBA skip over the line without running the code. You can use comments to document your code as well as to skip over lines of code you’ve decided not to run, but want to keep for reference in case you need them again.
We’ll also add a shortcut to the toolbar that indents or outdents (the opposite of indent) blocks of code. Indenting is a great way to make your code easier to read.
Finally, the Current Region object is a way for Excel to select all of the rows and columns in a given area. Give Excel a cell reference to start with, and Current Region will select all of the rows and columns around that cell until it finds blank rows and columns. If your data changes frequently and does not have blank cells in the middle of the data, Current Region is a good way to select all of the data you need to work with.