Note where the common object

1, commonly used statement:

(1) cells.ClearContents # clears all data in 
(2) Aplication.SCreenUpdating = False #EXCEL not the calculated result is displayed on the screen, to improve the execution speed of the computer
(3) Aplication.DisplayAlerts = False # does not display a warning message
( 4) Application.worksheetFunction. worksheet function () # call the worksheet functions, but noted that the same function in VBA, you can not reference worksheet function, otherwise it will error

 2, workbook

(1) Workbooks.open Filename: = " F: \ Book1.xls" # open a workbook 
(2) Workbooks.Close savechange: = True # Close all workbooks and save the changes 
(3) Workbooks.Add before / after: = worksheets ( "sheet name") # after the worksheet / before insertion. Default ago 
        Workbooks.Add Count: = 3 # 3 is inserted into the worksheet before worksheet 
   summary: Before the first insertion of a worksheet called "payroll" worksheet 
            Worksheets.Add (before: = Worksheets (1 ) ) .Name = "payroll"

Guess you like

Origin www.cnblogs.com/feiwenshangli/p/11272886.html