Sub ConvertirLetrasANumero()
Dim rng As Range
Dim texto As String
Dim palabras() As String
Dim total As Long, temporal As Long
Dim i As Integer
If Selection.Type = wdSelectionNormal Then
Set rng = Selection.Range
texto = LCase(Trim(rng.Text))
palabras = Split(texto, " ")
For i = LBound(palabras) To UBound(palabras)
Select Case palabras(i)
' Especiales y Decenas
Case "ochenta": temporal = temporal + 80
Case "ochentay uno ": temporal = temporal + 81
Case "ochenta y dos": temporal = temporal + 82
Case "ochenta y tres": temporal = temporal + 83
Case "ochenta y cuatro": temporal = temporal + 84
Case "ochenta y cinco": temporal = temporal + 85
Case "ochenta y seis": temporal = temporal + 86
Case "ochenta y siete": temporal = temporal + 87
Case "ochenta y ocho ": temporal = temporal + 88
Case "ochenta y nueve": temporal = temporal + 89
' Multiplicadores
Case "mil":
If temporal = 0 Then temporal = 1
total = total + (temporal * 1000)
temporal = 0
End Select
Next i