对于生成的汇总表,如果光标焦点在本汇总表,操作出错,焦点移开汇总表则操作正常.出错原因在如下代码,而这个代码是需要的
菜单事件_AfterSelRangeChange
'右下角显示表的区域计算
Dim Sum,Average,Count,Max,Min As Double
With CurrentTable
Sum = CurrentTable.Aggregate(AggregateEnum.Sum, .TopRow, .LeftCol, .BottomRow, .RightCol)
Average = CurrentTable.Aggregate(AggregateEnum.Average, .TopRow, .LeftCol, .BottomRow, .RightCol)
Count = CurrentTable.Aggregate(AggregateEnum.Count, .TopRow, .LeftCol, .BottomRow, .RightCol)
Max = CurrentTable.Aggregate(AggregateEnum.Max, .TopRow, .LeftCol, .BottomRow, .RightCol)
Min = CurrentTable.Aggregate(AggregateEnum.Min, .TopRow, .LeftCol, .BottomRow, .RightCol)
End With
StatusBar.Message3 =" 累计:" & Cstr(sum) & " 平均:" & Cstr(Average) & " 计数:" & Cstr(Count) & " 最大:" & Cstr(Max) & " 最小:" & Cstr(Min) & " "
此主题相关图片如下:12.gif
