And just to get this into the archives, here's another UDF, apparently by
Laurent Longre.
HTH,
Bernie
MS Excel MVP
'----------------------------------------------------------------------
' Conversion d'un nombre < 4000 en chiffres romains (style "classique")
' vers un nombre en chiffres arabes
'----------------------------------------------------------------------
'Laurent Longre, mpfe
Function ROMINVERSE(Nombre As String)
Const Symb = "IVXLCDM"
Dim I As Integer, J As Integer
Dim K As Integer, L As Integer, S As Integer
Dim C As String * 1, Prec As Boolean
On Error GoTo Erreur
I = Len(Nombre)
Do
K = InStr(1, Symb, Mid$(Nombre, I, 1))
If K = 0 Or K = J Then Err.Raise xlErrValue
S = IIf(K Mod 2, 1, 5) * 10 ^ ((K - 1) \ 2)
If K < J Then
If Not Prec Then Err.Raise xlErrValue
Select Case Mid$(Nombre, I, 2)
Case Is = "ID", Is = "IM", Is = "VX", Is = "VD", _
Is = "VM", Is = "LC", Is = "DM"
Err.Raise xlErrValue
End Select
ROMINVERSE = ROMINVERSE - S
I = I - 1
Prec = False
ElseIf K Mod 2 Then
C = Mid$(Symb, K, 1)
L = 0
Do
If Mid$(Nombre, I, 1) = C Then
If L = 3 Then Err.Raise xlErrValue
ROMINVERSE = ROMINVERSE + S
I = I - 1
L = L + 1
Else
Prec = L = 1
Exit Do
End If
Loop While I
Else
ROMINVERSE = ROMINVERSE + S
I = I - 1
Prec = True
End If
J = K
Loop While I
Exit Function
Erreur:
ROMINVERSE = CVErr(Err)
End Function