Converts an arabic numeral to roman, as text.
Syntax
expression.Roman (Arg1, Arg2)
expression A variable that represents a WorksheetFunction object.
Parameters
Name | Required/Optional | Data type | Description |
---|---|---|---|
Arg1 | Required | Double | Number - the Arabic numeral that you want converted. |
Arg2 | Optional | Variant | Form - a number specifying the type of roman numeral you want. The roman numeral style ranges from Classic to Simplified, becoming more concise as the value of form increases. |
Return value
String
Remarks
The following table describes the values that can be used for Arg2.
Form | Type |
---|---|
0 or omitted | Classic. |
1 | More concise. |
2 | More concise. |
3 | More concise. |
4 | Simplified. |
TRUE | Classic. |
FALSE | Simplified. |
If number is negative, the #VALUE! error value is returned.
If number is greater than 3999, the #VALUE! error value is returned.
Examples
Thіѕ following example converts Arаbіс numbers to roman numbеrѕ.
Sub ArabicToRoman()
Dim rng As Range
On Error Resume Next
Selection.Value = Selection.Value
For Each rng In Selection
If WorksheetFunction.IsNumber(rng) Then
rng.Value = WorksheetFunction.Roman(rng)
End If
Next rng
End Sub