Application Object Common Properties
"ActiveCell Properties"
The ActiveCell property returns a Range object that represents the cell in the current window or in the specified window. This property is not valid if the window does not display a worksheet.
"Code Area"
Subactivates the cell () Worksheets ("Sheet1"). Activate'activates the current cell withActiveCell. Value="Tina" with . Font. Bold=True 'set to Bold. Italic =True 'set to italic. Size = - 'Set Font size End with End withEnd Sub
"Results show"
Note: The word is displayed in B2 because I've already hovered over the mouse before executing.
"ActiveWorkbook Properties"
ActiveWorkbook is a read-only property that returns a Workbook object that represents the workbook in the active window
No window or Information window or Clipboard window is open as the active window, nothing is returned
"Code Area"
Sub Test ActiveWorkbook Property () Dim as Object Set obj = ActiveWorkbook CStr(obj. Application.value)End Sub
"Results show"
"Caption Properties"
Caption is a read-write property that sets or returns the name displayed on the title bar of Microsoft's main window, which returns a string type. If the title is not set for Microsoft's main window, or if its value is set to empty, this property returns a
"Microsoft excle" as the default title
"Code Area"
Sub Change title () " oliver--excle " End Sub
"Results show"
The Range Property
The Range property returns a Range object that represents a cell or range of cells
Range Instance Address: http://www.cnblogs.com/OliverQin/p/6198441.html
"Selection Properties"
The Selection property represents the return of the selected object in the active window for the Application object
"Code Area"
Sub Test Selection Property () Worksheets ("Sheet1"). Activate Range ("A1"). Select ' clears the contents of the Sheet1 worksheet End Sub
"Results show"
Before execution
After execution
"Sheets Method"
The Sheets property is a read-only property that returns a Sheets collection whose type is a sheets object
SubTest Sheets Property ()DimWss asSheetsDimI as IntegerApplication.workbooks (1). ActivateSetWSS =Application.sheets Debug.Print"The current workbook name is as follows:"Debug.Print fori =1 toSheets.count Debug.Print Sheets (i). NameNextEnd Sub
"Results show"
"VBA Programming" 11.Application objects