Skip to main content

Range.DataTypeToText method

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

If any of the cells in the range are a Linked data type, such as Stocks or Geography, this call will convert their values to text.

Syntax

expression.DataTypeToText

expression A variable that represents a Range object.

Remarks

The call can fail if none of the cells in the range are a Linked data type. In this case, it will throw runtime exception 1004.

Example

This code will convert the range E5:G10 into text.

Worksheets(1).Range("E5:G10").DataTypeToText

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>