Skip to content

Files

Latest commit

 

History

History
44 lines (30 loc) · 1 KB

Excel.PivotField.DataType.md

File metadata and controls

44 lines (30 loc) · 1 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
PivotField.DataType property (Excel)
vbaxl10.chm240079
vbaxl10.chm240079
Excel.PivotField.DataType
95671f37-9886-822f-672c-1c5706b9c0bf
05/04/2019
medium

PivotField.DataType property (Excel)

Returns an XlPivotFieldDataType value that represents the type of data in the PivotTable field.

Syntax

expression.DataType

expression A variable that represents a PivotField object.

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

[!includeSupport and feedback]