Secrets of the Office Masters: Stuck on a Line of VBA Code?

If you get stuck while writing a line of VBA code and don't quite know where to turn, consider right-clicking the command or parameter that's giving you problems, as shown in the following figure.


Figure 41.9.


You have these options:

  • List Properties/Methods gives you a list of all the properties and methods that can replace the property or method you clicked. Pick this option only if you think you've chosen the wrong command.


    Figure 41.10.


  • List Constants tells you which other predefined constants can be used to replace the current constant. This can come in handy if you discover you've chosen the wrong constant, and you don't want to use F1 to review all the details about a command.


    Figure 41.11.


  • Quick Info summarizes all parameters for a particular command. Use this option if you've somehow switched parameters around on the command line.


    Figure 41.12.


  • Parameter Info duplicates the information from Quick Info, except it highlights the parameter where you right-clicked. That can come in handy if you're working with a command (such as MsgBox or InputBox, for example) where it's easy to lose track of which parameter you're working on.


    Figure 41.13.


  • Complete Word brings up the auto-completion box you're accustomed to using. It can help if you're backspacing or retyping a command, and the VBA Editor isn't popping up the choices automatically.


    Figure 41.14.


Don't forget to use the Object Browser if you're completely stuck on what objects, properties, and methods might be available. And don't hesitate to hit F1 to bring up the full-blown Help system. Examples in the Help system, in particular, can give you hints that the text never approaches.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.15.63.145