按ALT+F11弹出VBA编辑器 方法一 Private Sub Worksheet_Change(ByVal Target As Range) 方法二 Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ShtC As Integer
Dim RngC As Integer
Dim i As Integer
ShtC = Sheets(1).[A65536].End(xlUp).Row
RngC = Sheets.Count
For i = 1 To Application.WorksheetFunction.Min(ShtC, RngC)
Sheets(i).Name = Sheets(1).Cells(i, 1)
Next i
End Sub
|
|