Set pvtTable = Worksheets("Sheet1").Range("A3").PivotTable
Select Case pvtTable.PivotFields("ORDER_DATE").DataType
Case Is = xlText
MsgBox "The field contains text data"
Case Is = xlNumber
MsgBox "The field contains numeric data"
Case Is = xlDate
MsgBox "The field contains date data"
End Select=====================Excel的数据类型
xlParamTypeBigInt
xlParamTypeBinary
xlParamTypeBit
xlParamTypeChar
xlParamTypeDate
xlParamTypeDecimal
xlParamTypeDouble
xlParamTypeFloat
xlParamTypeInteger
xlParamTypeLongVarBinary
xlParamTypeWChar
xlParamTypeLongVarChar
xlParamTypeNumeric
xlParamTypeReal
xlParamTypeSmallInt
xlParamTypeTime
xlParamTypeTimeStamp
xlParamTypeTinyInt
xlParamTypeUnknown
xlParamTypeVarBinary
xlParamTypeVarChar
Select Case pvtTable.PivotFields("ORDER_DATE").DataType
Case Is = xlText
MsgBox "The field contains text data"
Case Is = xlNumber
MsgBox "The field contains numeric data"
Case Is = xlDate
MsgBox "The field contains date data"
End Select=====================Excel的数据类型
xlParamTypeBigInt
xlParamTypeBinary
xlParamTypeBit
xlParamTypeChar
xlParamTypeDate
xlParamTypeDecimal
xlParamTypeDouble
xlParamTypeFloat
xlParamTypeInteger
xlParamTypeLongVarBinary
xlParamTypeWChar
xlParamTypeLongVarChar
xlParamTypeNumeric
xlParamTypeReal
xlParamTypeSmallInt
xlParamTypeTime
xlParamTypeTimeStamp
xlParamTypeTinyInt
xlParamTypeUnknown
xlParamTypeVarBinary
xlParamTypeVarChar
如:
Worksheets("Sheet1").Range("A1:D8").AutoFormat Format:=xlRangeAutoFormatClassic1
这样还好一点
大老,能大概讲讲什么意思吗?
我这里总是显示,不能取得RANGE 的PivotTable属性!为什么啊。请教啊
VB里面不认 你的写法。。等大概讲下什么意思。怎么操作吗?
我记得前一段时间刚刚有人问过类似的问题。
因为从VB界面DATAGIRD取出数据导出EXCEL。EXECL中数值列实际存为了字符型,在EXCEL中无法按数值排序。。很是头疼。客户老是抱怨这个问题。