编写菜单->主菜单->事件->AfterSelRangeChange
Dim t As Table
RibbonMenu.StatusBar.Message3 = ""
If e.Table IsNot CurrentTable OrElse CurrentTable Is Nothing Then Return Else t = CurrentTable End If If t.TopRow = t.BottomRow AndAlso t.LeftCol = t.RightCol Then Return End If For c As Integer = t.LeftCol To t.RightCol If c < 1 Then Continue For End If If t.Cols(c).IsNumeric = False Then Return End If Next
Dim count As Integer = t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) Dim sum As Double = t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) Dim avg As Double = t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol)
RibbonMenu.StatusBar.Message3 = count & "|" & sum & "|" & Avg
|