1 用workbook.open事件,代码为:worksheets(指定工作表名称).activate
2 按键代码:
With ActiveSheet
If .Name = "Sheet1" Then s = Application.Sum(.[f3:f30])
If .Name = "Sheet2" Then s = Application.Sum(.[g3:g30])
If .Name = "Sheet3" Then s = Application.Sum(.[h3:h30])
End With
1 用workbook.open事件,代码为:worksheets(指定工作表名称).activate
2 按键代码:
With ActiveSheet
If .Name = "Sheet1" Then s = Application.Sum(.[f3:f30])
If .Name = "Sheet2" Then s = Application.Sum(.[g3:g30])
If .Name = "Sheet3" Then s = Application.Sum(.[h3:h30])
End With