excel 编译错误 缺少end sub

2024-12-15 14:50:18
推荐回答(1个)
回答1:

Private Sub CommandButton1_Click()
Range("G1").Select
Application.CutCopyMode = False
Selection.Consolidate Sources:= _
"'C:\Documents and Settings\Administrator\桌面\[新建 Microsoft Excel 工作表 (5).xls]Sheet1'!C4:C5" _
, Function:=xlSum, TopRow:=False, LeftColumn:=True, CreateLinks:=False
Range("H5").Select
ActiveSheet.Shapes("CommandButton1").Select
End Sub

再去试一试!!!