怎样让这个宏应用到所有的EXCEL文件中???

For i = 1 To 100 Rows(i + m & ":" & i + m).Insert Shift:=xlDown m = m + 1 Next i End Sub
2024-11-20 17:17:41
推荐回答(1个)
回答1:

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