Source: http://blog.csdn.net/alexbnlee/article/details/6910151
Worksheet reference
Worksheets (3). Select where 3 is Index, which is the order below
Worksheets ("Sheet3"). Select where Sheet3 is Name
Sheet3.Select here, the Sheet3 is CodeName
Array
For Each Rng in Range ("A1: J10 ")
For Each Sht in Worksheets
For Each Book in Workbooks
Add Worksheet
Worksheets. Add. Name = "worksheet" directly Add a worksheet named "worksheet" at the beginning
Set Sht = Worksheets. Add (after: = Worksheets (Worksheets. Count)
ActiveSheet. CodeName indicates that table creation is assigned a sequential Name, namely, Sheet1 and Sheet2... in the project window, CodeName on the left and Name on the right.
ActiveSheet. Previous. Activate Previous worksheet activated
ActiveSheet. Next. Activate the last worksheet activated
Rows and columns
Rows (1). Select the first line
Rows ("1"). Select the first line
Colums (1). Select the first column
Colums ("A"). Select the first column
Cells (1, 1). EntireRow. Select the row of the selected cell
Cells (1, 1). EntireColumn. Select the column where the selected cell is located
Rows (""). Select the first to fourth Rows.
Columns ("A: D"). Select the first to fourth Columns.
Columns ("A: F"). AutoFit automatically distributes these Columns appropriately
Rows (""). AutoFit automatically distributes these Rows
WorkSheet event
Triggered when WorkSheet_Activate activates the document
WorkSheet_Change content change
WorkSheet_SelectionChange
Triggered when you right-click WorkSheet_BeforeRightClick
WorkSheet_BeforeDoubleClick is triggered when you double-click the left button.
WorkSheet_Calculate triggers an event when the unit is calculated and the formula is run.
WorkSheet_Deactivate this event is triggered when the worksheet is switched.
Source: http://msdn.microsoft.com/zh-cn/library/d4f0cb22%28v=VS.80%29.aspx
Copy between worksheets:
Sub sdlkfj () Sheets ("road bed (2 )"). activate Cells. select 'all copies Selection. copy Sheets. add before: = Sheets (2) Cells. select ActiveSheet. paste 'paste all Application. cutCopyMode = false' disable cut copy mode End Sub