Info

At this point, you can more or less see how just about every option that you do in Excel while the macro recorder is running corresponds to a bit of code in the recorded macro.

Here is another example. The next line of code in the macro is Selection.End(xlDown).Select

You can click and get help for three topics in this line of code: Selection, End, and Select. Assuming that Selection and Select are somewhat self-explanatory, click in the word End and press F1 for help. A Context Help dialog box pops up, saying that there are two possible help topics for End. There is one in the Excel library and one in the VBA library (see Figure 2.14).

Figure 2.14

Sometimes when you click in a VBA keyword and hit F1, you must guess which help library to use.

Figure 2.14

Sometimes when you click in a VBA keyword and hit F1, you must guess which help library to use.

If you are new to VBA, it can be frustrating to know which one to select. Take your best guess and click Help. In this case, the End help topic in the VBA library is talking about the End statement (see Figure 2.15), which is not what we have here.

Figure 2.15

If you guess wrong,you are taken to a help topic that is completely off-topic. It is easy enough to try again.

Figure 2.15

If you guess wrong,you are taken to a help topic that is completely off-topic. It is easy enough to try again.

0 0

Post a comment