Foxtable(狐表)用户栏目专家坐堂 → [求助]几个单元格求和!


  共有7113人关注过本帖树形打印复制链接

主题:[求助]几个单元格求和!

帅哥哟,离线,有人找我吗?
jianjingmaoyi
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:三尾狐 帖子:760 积分:4714 威望:0 精华:0 注册:2011/12/17 18:37:00
  发帖心情 Post By:2013/4/14 21:00:00 [显示全部帖子]

仿右下角计算:

If Forms("窗口1").Opened Then
    Dim Sum,Average,Count 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)
    End With
    Forms("窗口1").Controls("Label1").text ="    累计:" & Cstr(sum) & "    平均:" & Cstr(Average) & "    计数:"  & Cstr(Count) & " "
End If


表事件: AfterSelRangeChange

 回到顶部