Range.HasRichDataType property (Excel)
True if all cells in the range contain a Rich data type. False if none of the cells in the range contains a Rich data type; otherwise, null. Read-only Variant.
expression A variable that represents a Range object.
Linked data types, such as Stocks or Geography, are a kind of Rich data type.
For linked types, only cells whose LinkedDataTypeState property is xlLinkedDataTypeStateValidLinkedData, xlLinkedDataTypeStateFetchingData, or xlLinkedDataTypeStateBrokenLinkedData will be counted as Rich data types by the HasRichDataType property.
Cells in the xlLinkedDataTypeStateDisambiguationNeeded or xlLinkedDataTypeStateNone states do not count as Rich data types.
For more information about possible Linked data type states, see the XlLinkedDataTypeState enumeration.
This example prompts the user to select a range on Sheet1. If every cell in the selected range contains a Rich data type, the example displays a message.
Worksheets("Sheet1").Activate Set rr = Application.InputBox( _ prompt:="Select a range on this worksheet", _ Type:=8) If rr.HasRichDataType = True Then MsgBox "Every cell in the selection contains a Rich Data" End If
Support and feedback
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.