northwolves版主解答 http://club.excelhome.net/dispbbs.asp?
boardid=2&id=251426&star=2#914934
Sub 在当前工作组各表中分别执行指定宏()
Dim SH As Worksheet
For Each SH In ActiveWindow.SelectedSheets
SH.Activate
临时
Next
End Sub
'临时宏中原录制代码ActiveWorkbook.Names.Add Name:="临时",
RefersToR1C1:="=Sheet1!R1C1" '插入名称准备返回使用
'临时宏经修改后的代码ActiveWorkbook.names.Add Name:="临时",
RefersToR1C1:="=" + ActiveSheet.Name + "!R1C1" '插入名称准备返回使用
'冰山上的来客解答 http://club.excelhome.net/dispbbs.asp?
boardid=2&id=251426
'其中指定宏代码一定要避免执行工作表的Select方法
Dim SelShts As Sheets
Dim sht As Worksheet
Sub 在当前工作组各表中分别执行指定宏()
Set SelShts = ActiveWindow.SelectedSheets
For Each sht In SelShts
Call 临时
Next
End Sub
|
|
susan