Skip to main content

Range.HasRichDataType property

Table of contents
  1. Syntax
  2. Remarks
  3. Example

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.

Syntax

expression.HasRichDataType

expression A variable that represents a Range object.

Remarks

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.

Example

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

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>