Dim HGroup As String
Dim VGroup As String
Dim TotalOn As String
'获取输入内容
With RibbonTabs("实战演练二")("任务九")
HGroup = .Items("HGroup").Text
VGroup = .Items("VGroup").Text
TotalOn = .Items("TotalOn").Text
End With
With CurrentTable.Cols
If HGroup >"" AndAlso .Contains(HGroup) Then '如果已经输入有效水平分组
If VGroup >"" AndAlso .Contains(VGroup) Then '如果已经输入有效垂直分组
If TotalOn >"" AndAlso .Contains(TotalOn) Then '而且统计列有效
Dim b As New CrossTableBuilder("统计表",DataTables("订单"))
b.HGroups.AddDef(HGroup) '添加水平分组
b.VGroups.AddDef(VGroup) '添加垂直分组
b.Totals.AddDef(TotalOn) '添加统计列
b.Build '生成统计表
MainTable = Tables("统计表")
End If
End If
End If
End With
事例里只能是针对当年的”订单“表,怎么样设置成操作的当前表?谢谢!