Foxtable(狐表)用户栏目专家坐堂 → 如何实现和excel中以下功能


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

主题:如何实现和excel中以下功能

美女呀,离线,留言给我吧!
yangming
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信 一级勋章
等级:超级版主 帖子:4109 积分:23338 威望:0 精华:21 注册:2008/9/1 20:07:00
  发帖心情 Post By:2011/11/29 11:59:00 [显示全部帖子]

楼主要的是这段代码吧?

 

'以下代码用于在状态栏显示自动计算结果,如果不需要自动计算,可删除这一段
If Vars("SysUpdateAggregate")
    If Windows.Forms.Control.MouseButtons <> Windows.Forms.MouseButtons.None OrElse Windows.Forms.Control.ModifierKeys <> Windows.Forms.Keys.None Then
        Return
    End If
    Dim Str1 As String = ""
    Vars("SysUpdateAggregate") = False
    With RibbonTabs("Other").Groups("Aggregate")
        With CType(.Items("Aggregate"), RibbonMenu.ToggleButton)
            If .Pressed = False Then
                Return
            End If
        End With
        If CType(.Items("Count"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "计数:" & t.Aggregate(AggregateEnum.Count, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("Sum"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "累计:" & t.Aggregate(AggregateEnum.Sum, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("Average"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "平均:" & t.Aggregate(AggregateEnum.Average, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("Max"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "最大:" & t.Aggregate(AggregateEnum.Max, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        If CType(.Items("Min"), RibbonMenu.CheckBox).Checked Then
            Str1 = Str1 & "最小:" & t.Aggregate(AggregateEnum.Min, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
        End If
        With CType(.Items("Other"), RibbonMenu.MenuButton)
            If CType(.Items("Std"), RibbonMenu.ToggleButton).Pressed Then
                Str1 = Str1 & "标准差:" & t.Aggregate(AggregateEnum.Std, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
            End If
            If CType(.Items("StdPop"), RibbonMenu.ToggleButton).Pressed Then
                Str1 = Str1 & "总体标准差:" & t.Aggregate(AggregateEnum.StdPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
            End If
            If CType(.Items("Var"), RibbonMenu.ToggleButton).Pressed Then
                Str1 = Str1 & "方差:" & t.Aggregate(AggregateEnum.Var, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
            End If
            If CType(.Items("VarPop"), RibbonMenu.ToggleButton).Pressed Then
                Str1 = Str1 & "总体方差:" & t.Aggregate(AggregateEnum.VarPop, t.TopRow, t.LeftCol, t.BottomRow, t.RightCol) & " "
            End If
        End With
    End With
    RibbonMenu.StatusBar.Message3 = Str1
End If


 回到顶部