外面套一层for,循环每个工作表,例如:Sub aaa() Dim sh As Worksheet For Each sh In ActiveWorkbook.Worksheets sh.Activate '操作工作表的代码放到这里 '…… NextEnd Sub