本帖最后由 hessen 于 2017-3-29 13:21 编辑
- Public Sub RangeSelection(sender As Object,e As SpreadsheetGear.Windows.Forms.RangeSelectionChangedEventArgs)
- On Error Resume Next
- Dim cel As IRange
- Dim s As Decimal
- s = 0
- For Each cel in e.RangeSelection
- s = s + CDec(cel.cells(0,0).value)
- next
- IF e.RangeSelection.Columns.Count > 1 or e.RangeSelection.Rows.Count > 1 Then
- MessageBox.show("选区合计:" & s.ToString )
- End IF
- End Sub'单元格选择后执行的事件
复制代码
KB_VBA.rar
(3 KB, 下载次数: 19)
|
|
hessen