Office中国论坛/Access中国论坛
标题:
[求助]关于宏运行结果的问题!
[打印本页]
作者:
sqwzhandsome
时间:
2005-6-24 03:27
标题:
[求助]关于宏运行结果的问题!
如何更改下列使宏代码使运行出的透视表,在数据栏里"货数量(+/-)"为求和,而不是计数!
Sheets("SapData").Select
Dim ra1 As Range
Dim rn1 As Integer
Dim cn1 As Integer
Set ra1 = ActiveCell.CurrentRegion
rn1 = ra1.Rows.Count
cn1 = ra1.Columns.Count
str1 = "'SapData'!R1C1:R" & rn1 & "C" & cn1
ActiveSheet.PivotTableWizard SourceType:=xlDatabase, SourceData:= _
str1, TableDestination:="'[Data1.xls]TotalSapData'!R1C1", _
TableName:="
ivotTables3"
ActiveSheet.PivotTables("
ivotTables3").AddFields RowFields:="售达方代码", ColumnFields _
:="物料"
ActiveSheet.PivotTables("
ivotTables3").PivotFields("交货数量(+/-)").Orientation = _
xlDataField
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
作者:
tase
时间:
2005-6-25 23:05
PivotField.Function属性
欢迎光临 Office中国论坛/Access中国论坛 (http://www.office-cn.net/)
Powered by Discuz! X3.3