DataType Property [Excel 2003 VBA Language Reference]

DataType property as it applies to the Parameter object.

XlParameterDataType

XlParameterDataType can be one of these XlParameterDataType constants.
xlParamTypeBinary
xlParamTypeChar
xlParamTypeDecimal
xlParamTypeFloat
xlParamTypeLongVarBinary
xlParamTypeNumeric
xlParamTypeSmallInt
xlParamTypeTimestamp
xlParamTypeUnknown
xlParamTypeVarChar
xlParamTypeBigInt
xlParamTypeBit
xlParamTypeDate
xlParamTypeDouble
xlParamTypeInteger
xlParamTypeLongVarChar
xlParamTypeReal
xlParamTypeTime
xlParamTypeTinyInt
xlParamTypeVarBinary
xlParamTypeWChar

expression.DataType

expression Required. An expression that returns one of the above objects.

DataType property as it applies to the PivotField object.

XlPivotFieldDataType

XlPivotFieldDataType can be one of these XlPivotFieldDataType constants.
xlDate
xlNumber
xlText

expression.DataType

expression Required. An expression that returns one of the above objects.

Example

This example displays the data type of the field named "ORDER_DATE."

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

Applies to | Parameter Object | PivotField Object