if Forms("主窗口").Opened then Dim t as Table = CurrentTable For c As Integer = t.LeftCol To t.RightCol If c = 0 then Return End IF If t.Cols(c).IsNumeric = False Then Return End If Next Dim Sum,Average,Count As Integer Sum = CurrentTable.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) Average = CurrentTable.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) Count = CurrentTable.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) Forms("主窗口").Controls("Label1").text =" 累计: " & Cstr(sum) & " 平均: " & Cstr(Average) & " 计数: " & Cstr(Count) & " " end if
|