Skip to main content

WorksheetFunction.Arabic method

Converts a Roman numeral to an Arabic numeral.

Syntax

expression.Arabic (Arg1)

expression A variable that represents a WorksheetFunction object.

Parameters

Name Required/Optional Data type Description
Arg1 Required String The Roman numeral that you want to convert.

Return value

Double

Examples

The following example converts Roman Numbers to Arabic Numbers.

Sub RomanToArabic()
    Dim rng As Range
    On Error Resume Next
    Selection.Value = Selection.Value
    For Each rng In Selection
        If WorksheetFunction.IsText(rng) Then
            rng.Value = WorksheetFunction.Arabic(rng)
        End If
    Next rng
End Sub

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>