Sub 按钮2_Click() Dim sht As Worksheet Dim rng As Range Dim a%, i% For Each sht In Sheets If sht.Name <> "主表" Then If IsEmpty(sht) = False Then a = sht.Range("B65536").End(xlUp).Row sht.Activate ActiveSheet.Range(Cells(2, 2), Cells(a, 11)).Select Selection.Copy With Sheets("主表") Set rng = .Range("B65536").End(xlUp).Offset(1) rng.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _ :=False, Transpose:=False For i = 2 To .Range("B65536").End(xlUp).Row .Range("A" & i) = i - 1 Next End With End If End If Next Sheets("主表").Activate End Sub