Dim t As Table = Tables("表A")
Dim g As SubtotalGroup
t.SubtotalGroups.Clear()
t.GroupAboveData = False
t.TreeVisible = False
t.SpillNode = True
g = New SubtotalGroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "第一列"
g.TotalOn = "第三列,第九列"
g.Caption = "{0} 小计"
t.SubtotalGroups.Add(g)
g = New Subtotalgroup
g.Aggregate = AggregateEnum.Sum
g.GroupOn = "*"
g.TotalOn = "第三列,第九列"
g.Caption = "总计"
t.SubtotalGroups.Add(g)
t.Subtotal()
Tables("表A").Grid.Tree.Show(0)