可能重复:
Excel VBA:批量重命名工作表
谢谢您的帮助。我可能没有适当地迭代。也许我应该为活动工作表分配一个整数?
Sub TabNames()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
ActiveSheet.Name = "herp"
Next ws
ActiveSheet.Name = "derp"
Next ws
ActiveSheet.Name = "herp derp"
Next ws
ActiveSheet.Name = "derp herp"
Next ws
ActiveSheet.Name = "herp herp"
Next ws
ActiveSheet.Name = "derp derp"
End Sub