The Properties Window in the Visual Basic Editor of Excel
|
613-749-4695 (Peter) |
Tips and Ideas on Excel |
Tips and Ideas on Macros |
VBA Chapter 3B of 24: The Properties Window in the Visual Basic Editor of ExcelNote: The images and the text below refer to the workbook "vba-tutorial-editor.xls" The Properties window shows you the properties of the object that is selected in the Project Window or of the control that you have selected on a userform. Click once on any object in the Project window and its properties appear in the Properties window. You can modify any of the properties from the properties window. The list of properties changes as you select different types of components (ThisWorkbook, sheets, modules, userforms or controls). For example, click on "Sheet1" in the Project window and you will see the following properties for the sheet: There are 3 properties that you will work with: the "(Name)" property which is the programmatical name of the sheet, the "Name" property which is the caption (the name on the tab in Excel) and the "Visible" property where you make a sheet either -1-xlSheetVisible or -0- xlSheetHidden. You can change all these properties (except "(Name)") programmatically or manually. For example in VBA you would write Sheet1.Visible=True or Sheet1.Visible=False
Click on Module1 of "vba-tutorial-editor.xls" in the Project window and your property window will look like this one. There is only one property, the name. Please, please, please name your modules. There is nothing less informative than Module1, Module2, Module3.... It is so much friendlier to see modImport, modDatabase, modExportData, modWhatever. Give a significant name to your modules starting with the prefix "mod "and a first capital letter for any significant word comprised in the name. You will see later how important this prefix and capital letters habit becomes. To see the properties of userforms and their controls see chapters 23 and 24. If you click on ThisWorkbook in the Project window you will see this: Unless you are a "real" programmer who is trying to reinvent the wheel you will not work with these properties. |
Next Chapter: The Code Window in the Excel VB Editor |
VBA Table of Contents |
Discover Even More in 50 Excel spreadsheets |
|
613-749-4695 (Peter) |
Tips and Ideas on Excel |
Tips and Ideas on Macros |
The Properties Window in the Visual Basic Editor of Excel