title | keywords | f1_keywords | api_name | ms.assetid | ms.date | ms.localizationpriority | ||
---|---|---|---|---|---|---|---|---|
PivotField.DataType property (Excel) |
vbaxl10.chm240079 |
|
|
95671f37-9886-822f-672c-1c5706b9c0bf |
05/04/2019 |
medium |
Returns an XlPivotFieldDataType value that represents the type of data in the PivotTable field.
expression.DataType
expression A variable that represents a PivotField object.
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
[!includeSupport and feedback]