VBA 用for each 给当前工作簿的所有工作表改名,常用集合
Sub demo45() Dim ws As Worksheet ‘把ws 定义为一个工作表对象 For Each ws In Worksheets '用for each 遍历对象集合 ws.Name = "哈哈" & ws.Name ’改名 Next End Sub
Sub demo45() Dim ws As Worksheet ‘把ws 定义为一个工作表对象 For Each ws In Worksheets '用for each 遍历对象集合 ws.Name = "哈哈" & ws.Name ’改名 Next End Sub