我试过这段代码:
Private Sub CommandButton11_Click()
Sheetcount = ActiveWorkbook.Sheets.Count
For shtCount = 1 To Sheetcount
shtname = Sheets(shtCount).Name
If InStr(shtname, "Sheet") = 0 And InStr(shtname, "SETUP") = 0 Then
Sheets(shtname).Activate
BrkPnt = 0
ActiveSheet.Range("A100").Select
lastcol = ActiveSheet.Cells(100, Columns.Count).End(xlToLeft).Column
ActiveSheet.Cells(100, lastcol).Select
ActiveSheet.Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Range(Selection, Selection.End(xlToLeft)).Select
ActiveSheet.Range(Selection, Selection.End(xlToLeft)).Select
Application.Run ("'toolbox.xla'!toolbox")
a = 1
End If
Next shtCount
End Sub
但似乎代码没有返回循环。