Get Details in Excel VBA Code
Did you ever get an Excel file from someone else, and try to sort out their Excel VBA code? Or, even worse, open an Excel file that you wrote long ago, and try to remember what all those variables mean?
I spend lots of time staring at Excel code, but apparently I don't use the right-click menu too often, because I hadn't noticed a couple of handy commands until recently. These commands can help you decipher that mysterious code, and unravel the complicated sections.
Excel VBA Quick Info
The first handy command is Quick Info. I have Auto Quick Info turned on in the VBE Editor options, and it helps me remember the syntax as I type the code.
What I didn't realize was that you can right-click on a variable, function, statement, method, or procedure in the code, and click Quick Info.
A tooltip appears, with details on the selected item.
Excel VBA Definition
The other right-click command that I finally discovered is the Definition command.
Click the Definition command, and it takes you to the selected variable's definition. Finding the definition is easy in most procedures, but in a long procedure, with a long list of variables, the Definition command really makes the job easier. It's especially helpful if the variable is defined on a different code module!