Skip to main content

WorksheetFunction.Text method

Converts a value to text in a specific number format.

Syntax

expression.Text (Arg1, Arg2)

expression A variable that represents a WorksheetFunction object.

Parameters

Name Required/Optional Data type Description
Arg1 Required Variant A numeric value, a formula that evaluates to a numeric value, or a reference to a cell containing a numeric value.
Arg2 Required String A number format in text form in the Category box on the Number tab in the Format Cells dialog box.

Return value

String

Examples

The following example converts current system time to ISO 8601 UTC Time Stamp (No Milliseconds).

Application.WorksheetFunction.Text(Now, "yyyy-mm-ddThh:MM:ss.000Z")

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>