formula para convertir numeros a letras en excel
Convertir Numeros a Letras en Exel (Argentina)
abris un exel, vas a herramientas, macro, macros. Donde dice nombre de la macro, pones n1 y despueshacé click en crear.
Te va a abrir un Visual Basic. Justo donde está el cursor, pegá lo siguiente:
Public Function NL(ByVal Numero As Double) As String
Dim NumTmp As String
Dim c01 AsInteger
Dim c02 As Integer
Dim pos As Integer
Dim dig As Integer
Dim cen As Integer
Dim dec As Integer
Dim uni As Integer
Dim letra1 As String
Dim letra2 As String
Dim letra3 As String Dim Leyenda As String
Dim Leyenda1 As String
Dim TFNumero As String
If Numero < 0 Then Numero = Abs(Numero)
NumTmp = Format(Numero, "000000000000000.00")
c01 = 1
pos = 1
TFNumero = "" Do While c01 = 1 And Val(Mid _
(NumTmp, 7, 3)) = 0 Then
Leyenda = "Mil Millones "
ElseIf cen + dec + uni >= 1 Then
Leyenda = "Mil "
End If
Case 3
If cen + dec = 0 And uni = 1 Then Leyenda = "Millon "
ElseIf cen > 0 Or dec > 0 Or uni > 1 Then
Leyenda = "Millones "
End If
Case 4
If cen + dec + uni >= 1 Then
Leyenda = "Mil "
End If
Case 5
If cen + dec + uni >= 1Then
Leyenda = ""
End If
End Select
c01 = c01 + 1
TFNumero = TFNumero + letra3 + letra2 + _
letra1 + Leyenda
Leyenda = ""
letra1 = ""
letra2 = ""
letra3 = ""
Loop
If Val(NumTmp) = 0Or Val(NumTmp) < 1 Then
Leyenda1 = "Cero Pesos"
ElseIf Val(NumTmp) = 1 Or Val(NumTmp) < 2 Then
Leyenda1 = "Pesos "
ElseIf Val(Mid(NumTmp, 4, 12)) = 0 Or Val(Mid _
(NumTmp, 10, 6)) = 0 Then Leyenda1 = "de Pesos "
Else
Leyenda1 = "Pesos "
End If
TFNumero = "Son Pesos " & TFNumero & "con " & Mid _
(NumTmp, 17) & "/100"
TFNumero = UCase(TFNumero)
NL = TFNumero
EndFunction
Private Function Centena(ByVal uni As Integer, _
ByVal dec As Integer, ByVal cen As Integer) As String
Select Case cen
Case 1
If dec + uni = 0 Then
cTexto = "cien "
Else
cTexto =...
Regístrate para leer el documento completo.