'先在当前工作簿中新建一个"汇总"工作表 Option Explicit Sub abc() Dim i, j, a, d, m Set d = CreateObject("scripting.dictionary") For Each i In Sheets d(i.Name) = 1 Next If d.exists("汇总") = False Then MsgBox "汇总": Exit Sub ReDim b(1 To 10 ^ 5, 1 To 1) For i = 1409 To 1479 If d.exists(CStr(i)) Then With Sheets(CStr(i)) '[e1]为标题 a = .Range("e2:e" & .cells(rows.count,"e").End(xlup).Row).Value For j = 1 To UBound(a) m = m + 1 b(m, 1) = a(j, 1) Next End With Else MsgBox i: Exit Sub '如果想跳过不存在的工作表就注释掉这行 End If Next With Sheets("汇总") .[e:e].ClearContents If m > 0 Then [e2].Resize(m) = b End With End Sub