EXCEL如何添加控件:在某个表中添加按钮,点击按钮弹出对话框,实现统计某几行的SUM计算?
2个回答
展开全部
打开菜单:视图----工具栏----控件工具箱
控件工具箱上面有《按钮》控件,把它画在Sheer1上面
双击按钮就出现写代码的代码窗口,在那里写代码:
Private Sub CommandButton1_Click()
Sheet1.Cells(1, 1) = ""
For i = 2 To 10
Sheet1.Cells(1, 1) = Sheet1.Cells(1, 1) + Sheet1.Cells(i, 1)
Next
End Sub
这里的cells(1,1)是A1 cells(2,1)是A2.......
cells(1,2)是B1 cells(1,3)是C1.......
希望采纳!!!!
控件工具箱上面有《按钮》控件,把它画在Sheer1上面
双击按钮就出现写代码的代码窗口,在那里写代码:
Private Sub CommandButton1_Click()
Sheet1.Cells(1, 1) = ""
For i = 2 To 10
Sheet1.Cells(1, 1) = Sheet1.Cells(1, 1) + Sheet1.Cells(i, 1)
Next
End Sub
这里的cells(1,1)是A1 cells(2,1)是A2.......
cells(1,2)是B1 cells(1,3)是C1.......
希望采纳!!!!
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询