|
Set xlSheet = xlBook.Worksheets("透视表")
xlSheet.Activate
Set PC = xlApp.ActiveWorkbook.PivotCaches.Create(xlExternal)
Set PC.Recordset = rs
Set PT = xlApp.ActiveSheet.PivotTables.Add(PC, xlApp.ActiveSheet.Range("A1"), "透视")
With xlApp.ActiveSheet.PivotTables("透视")
.PivotFields("日期").Orientation = xlPageField
.PivotFields("公司简称").Orientation = xlRowField
.PivotFields("客户名称").Orientation = xlRowField
.PivotFields("供应商").Orientation = xlRowField
.PivotFields("供应商").Subtotals(1) = False
.PivotFields("发票号").Orientation = xlRowField
.PivotFields("商品名称").Orientation = xlRowField
.PivotFields("商品名称").Subtotals(1) = False
.PivotFields("颜色").Orientation = xlColumnField
.PivotFields("金额").Orientation = xlDataField
'明明设定的是美元货币,但在Excel上总是显示人民币符号¥,不知道为何?
.DataBodyRange.NumberFormat = "$#,##0.00;-$#,##0.00"
.RowAxisLayout xlCompactRow
.TableStyle2 = "PivotStyleMedium13"
' .ColumnGrand = False
' .RowGrand = False
End With
明明设定的是美元货币$,但在Excel上总是显示人民币符号¥,不知道为何?
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
|