Microsoft Office Tutorials and References
In Depth Information
Try It
Try iT
Because this lesson is an introduction to the Visual Basic Editor environment, there are no
programming techniques to try, but you can get a jump on your familiarity with the VBE by considering
these items:
There are several ways to get into the VBE, but which way works best for you? As you’ve
seen, Alt+F11 works on all Excel versions, but if you are more of a mouse user than a
keyboard user, there are several options depending on what’s easiest for you:
In version 2003 you can click Tools Macro Visual Basic Editor, or you can keep
the Visual Basic toolbar visible, and click the Visual Basic Editor icon. You can also
right-click the workbook icon near the upper left corner of the Excel window (just
to the left of the File menu item), and select View Code, which will take you to that
workbook’s module in the VBE.
In versions 2007 and 2010, you can click the Visual Basic Editor icon on the
Developer tab.
In any version of Excel, you can right-click a worksheet tab and select “View Code,”
which will take you to that worksheet’s module in the VBE.
Take another look at the Object Browser and click around its classes and members. The VBA
object model is a vast library of information that no one would attempt to memorize, but the
idea here is to get a feel for the interwoven relationships among objects’ classes, properties,
and methods.
In the Project Explorer window, if you double-click an object such as a worksheet,
workbook, or module name, you will be taken directly to that object’s Code window. But also,
notice the pop-up menu when you right-click an object’s name in the Project Explorer. Go
ahead and click onto any of those menu items to get the gist of where they lead you and what
purpose they serve.
Get a bit of practice in with the Immediate window. If you were to enter some value into cell
A1, and then format cell A1 in bold font, you can enter these expressions in the Immediate
window and press Enter for each one:
? Range(“A1”).Value (will return whatever value you entered into A1).
? Range(“A1”).Font.Bold (will return True if you bolded A1, or False if you did not).
? Range(“A1”).ClearContents (will return True and clear the contents of cell A1).
There is no video to accompany this lesson.
Search JabSto ::

Custom Search