The Excel HELP file demonstrates how to test for data types in a PivotTABLE:
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
How do I test for DataTypes in a cell in a regular worksheet (my crude
attempts are)
msgbox ActiveCell.DataType
msgbox Range("A1").DataType
Bookmarks