transformar numeros en letras

16/11/2005 - 14:51 por Noelia | Informe spam
Hola:
Tengo un inconveniente , como puedo colocar en una celda el importe en
letras de un numero que se encuentra en otra celda
Gracias
Noe

Preguntas similare

Leer las respuestas

#1 Jesus Peralta
16/11/2005 - 17:42 | Informe spam
Que tal Noelia:
Enviame un mail y con gusto te envio como colocar el complemeto para que
conviertas numero a texto, paso a paso.
saludos.


"Noelia" escribió en el mensaje
news:
Hola:
Tengo un inconveniente , como puedo colocar en una celda el importe en
letras de un numero que se encuentra en otra celda
Gracias
Noe
Respuesta Responder a este mensaje
#2 Findeo
16/11/2005 - 19:27 | Informe spam
Mira el post de Héctor Miguel del 4 de Noviembre sobre este mismo tema (Re:
convertir numero en letra en idioma espa#ol)

Un saludo
Findeo


"Noelia" escribió:

Hola:
Tengo un inconveniente , como puedo colocar en una celda el importe en
letras de un numero que se encuentra en otra celda
Gracias
Noe
Respuesta Responder a este mensaje
#3 Noelia
16/11/2005 - 19:59 | Informe spam
Findeo:
Gracias por prestar atencion a mi inquietud, pero cuando voy al 4 de
noviembre no encuentro el post de Hector Miguel al que te referis.
Si podes ser mas explicito te lo agradeceria.
Noe


"Findeo" wrote:

Mira el post de Héctor Miguel del 4 de Noviembre sobre este mismo tema (Re:
convertir numero en letra en idioma espa#ol)

Un saludo
Findeo


"Noelia" escribió:

> Hola:
> Tengo un inconveniente , como puedo colocar en una celda el importe en
> letras de un numero que se encuentra en otra celda
> Gracias
> Noe
Respuesta Responder a este mensaje
#4 Mario
16/11/2005 - 23:30 | Informe spam
Noelia
Te paso un codigo, que tienes que pegar en un módulo del editor de visual
basic.
Guarda el libro de excel como "Complemento de M.S. Excel.
Luego busca la función en Insertar función.

Saludos Mario

Option Explicit
'Macro creada por mario Alberto Renzetti y Marisa Andrea Renzetti
Public Function NroEnLetras(ByVal curNumero As Double, Optional blnO_Final
As Boolean = True) As String
'Devuelve un número expresado en letras.
'El parámetro blnO_Final se utiliza en la recursión para saber si se debe
colocar
'la "O" final cuando la palabra es UN(O)
Dim dblCentavos As Double
Dim lngContDec As Long
Dim lngContCent As Long
Dim lngContMil As Long
Dim lngContMillon As Long
Dim strNumLetras As String
Dim strNumero As Variant
Dim strDecenas As Variant
Dim strCentenas As Variant
Dim blnNegativo As Boolean
Dim blnPlural As Boolean

If Int(curNumero) = 0# Then
strNumLetras = "CERO"
End If

strNumero = Array(vbNullString, "UN", "DOS", "TRES", "CUATRO", "CINCO",
"SEIS", "SIETE", _
"OCHO", "NUEVE", "DIEZ", "ONCE", "DOCE", "TRECE",
"CATORCE", _
"QUINCE", "DIECISEIS", "DIECISIETE", "DIECIOCHO",
"DIECINUEVE", _
"VEINTE")

strDecenas = Array(vbNullString, vbNullString, "VEINTI", "TREINTA",
"CUARENTA", "CINCUENTA", "SESENTA", _
"SETENTA", "OCHENTA", "NOVENTA", "CIEN")

strCentenas = Array(vbNullString, "CIENTO", "DOSCIENTOS", "TRESCIENTOS", _
"CUATROCIENTOS", "QUINIENTOS", "SEISCIENTOS",
"SETECIENTOS", _
"OCHOCIENTOS", "NOVECIENTOS")

If curNumero < 0# Then
blnNegativo = True
curNumero = Abs(curNumero)
End If

If Int(curNumero) <> curNumero Then
dblCentavos = Abs(curNumero - Int(curNumero))
curNumero = Int(curNumero)
End If

Do While curNumero >= 1000000#
lngContMillon = lngContMillon + 1
curNumero = curNumero - 1000000#
Loop

Do While curNumero >= 1000#
lngContMil = lngContMil + 1
curNumero = curNumero - 1000#
Loop

Do While curNumero >= 100#
lngContCent = lngContCent + 1
curNumero = curNumero - 100#
Loop

If Not (curNumero > 10# And curNumero <= 20#) Then
Do While curNumero >= 10#
lngContDec = lngContDec + 1
curNumero = curNumero - 10#
Loop
End If

If lngContMillon > 0 Then
If lngContMillon >= 1 Then 'si el número es >1000000 usa
recursividad
strNumLetras = NroEnLetras(lngContMillon, False)
If Not blnPlural Then blnPlural = (lngContMillon > 1)
lngContMillon = 0
End If
strNumLetras = Trim(strNumLetras) & strNumero(lngContMillon) & "
MILLON" & _

IIf(blnPlural, "ES ", " ")
End If

If lngContMil > 0 Then
If lngContMil >= 1 Then 'si el número es >100000 usa recursividad
strNumLetras = strNumLetras & NroEnLetras(lngContMil, False)
lngContMil = 0
End If
strNumLetras = Trim(strNumLetras) & strNumero(lngContMil) & " MIL "
End If

If lngContCent > 0 Then
If lngContCent = 1 And lngContDec = 0 And curNumero = 0# Then
strNumLetras = strNumLetras & "CIEN"
Else
strNumLetras = strNumLetras & strCentenas(lngContCent) & " "
End If
End If

If lngContDec >= 1 Then
If lngContDec = 1 Then
strNumLetras = strNumLetras & strNumero(10)
Else
strNumLetras = strNumLetras & strDecenas(lngContDec)
End If

If lngContDec >= 3 And curNumero > 0# Then
strNumLetras = strNumLetras & " Y "
End If
Else
If curNumero >= 0# And curNumero <= 20# Then
strNumLetras = strNumLetras & strNumero(curNumero)
If curNumero = 1# And blnO_Final Then
strNumLetras = strNumLetras & "O"
End If
If dblCentavos > 0# Then
strNumLetras = Trim(strNumLetras) & " CON " &
Format$(CInt(dblCentavos * 100#), "00") & "/100"
End If
NroEnLetras = strNumLetras
Exit Function
End If
End If

If curNumero > 0# Then
strNumLetras = strNumLetras & strNumero(curNumero)
If curNumero = 1# And blnO_Final Then
strNumLetras = strNumLetras & "O"
End If
End If

If dblCentavos > 0# Then
strNumLetras = strNumLetras & " CON " + Format$(CInt(dblCentavos *
100#), "00") & "/100"
End If

NroEnLetras = IIf(blnNegativo, "(" & strNumLetras & ")", strNumLetras)
End Function


"Noelia" escribió:

Hola:
Tengo un inconveniente , como puedo colocar en una celda el importe en
letras de un numero que se encuentra en otra celda
Gracias
Noe
Respuesta Responder a este mensaje
#5 Gabo Mag
17/11/2005 - 18:24 | Informe spam
GMD


"Mario" escribió:

Noelia
Te paso un codigo, que tienes que pegar en un módulo del editor de visual
basic.
Guarda el libro de excel como "Complemento de M.S. Excel.
Luego busca la función en Insertar función.

Saludos Mario

Option Explicit
'Macro creada por mario Alberto Renzetti y Marisa Andrea Renzetti
Public Function NroEnLetras(ByVal curNumero As Double, Optional blnO_Final
As Boolean = True) As String
'Devuelve un número expresado en letras.
'El parámetro blnO_Final se utiliza en la recursión para saber si se debe
colocar
'la "O" final cuando la palabra es UN(O)
Dim dblCentavos As Double
Dim lngContDec As Long
Dim lngContCent As Long
Dim lngContMil As Long
Dim lngContMillon As Long
Dim strNumLetras As String
Dim strNumero As Variant
Dim strDecenas As Variant
Dim strCentenas As Variant
Dim blnNegativo As Boolean
Dim blnPlural As Boolean

If Int(curNumero) = 0# Then
strNumLetras = "CERO"
End If

strNumero = Array(vbNullString, "UN", "DOS", "TRES", "CUATRO", "CINCO",
"SEIS", "SIETE", _
"OCHO", "NUEVE", "DIEZ", "ONCE", "DOCE", "TRECE",
"CATORCE", _
"QUINCE", "DIECISEIS", "DIECISIETE", "DIECIOCHO",
"DIECINUEVE", _
"VEINTE")

strDecenas = Array(vbNullString, vbNullString, "VEINTI", "TREINTA",
"CUARENTA", "CINCUENTA", "SESENTA", _
"SETENTA", "OCHENTA", "NOVENTA", "CIEN")

strCentenas = Array(vbNullString, "CIENTO", "DOSCIENTOS", "TRESCIENTOS", _
"CUATROCIENTOS", "QUINIENTOS", "SEISCIENTOS",
"SETECIENTOS", _
"OCHOCIENTOS", "NOVECIENTOS")

If curNumero < 0# Then
blnNegativo = True
curNumero = Abs(curNumero)
End If

If Int(curNumero) <> curNumero Then
dblCentavos = Abs(curNumero - Int(curNumero))
curNumero = Int(curNumero)
End If

Do While curNumero >= 1000000#
lngContMillon = lngContMillon + 1
curNumero = curNumero - 1000000#
Loop

Do While curNumero >= 1000#
lngContMil = lngContMil + 1
curNumero = curNumero - 1000#
Loop

Do While curNumero >= 100#
lngContCent = lngContCent + 1
curNumero = curNumero - 100#
Loop

If Not (curNumero > 10# And curNumero <= 20#) Then
Do While curNumero >= 10#
lngContDec = lngContDec + 1
curNumero = curNumero - 10#
Loop
End If

If lngContMillon > 0 Then
If lngContMillon >= 1 Then 'si el número es >1000000 usa
recursividad
strNumLetras = NroEnLetras(lngContMillon, False)
If Not blnPlural Then blnPlural = (lngContMillon > 1)
lngContMillon = 0
End If
strNumLetras = Trim(strNumLetras) & strNumero(lngContMillon) & "
MILLON" & _

IIf(blnPlural, "ES ", " ")
End If

If lngContMil > 0 Then
If lngContMil >= 1 Then 'si el número es >100000 usa recursividad
strNumLetras = strNumLetras & NroEnLetras(lngContMil, False)
lngContMil = 0
End If
strNumLetras = Trim(strNumLetras) & strNumero(lngContMil) & " MIL "
End If

If lngContCent > 0 Then
If lngContCent = 1 And lngContDec = 0 And curNumero = 0# Then
strNumLetras = strNumLetras & "CIEN"
Else
strNumLetras = strNumLetras & strCentenas(lngContCent) & " "
End If
End If

If lngContDec >= 1 Then
If lngContDec = 1 Then
strNumLetras = strNumLetras & strNumero(10)
Else
strNumLetras = strNumLetras & strDecenas(lngContDec)
End If

If lngContDec >= 3 And curNumero > 0# Then
strNumLetras = strNumLetras & " Y "
End If
Else
If curNumero >= 0# And curNumero <= 20# Then
strNumLetras = strNumLetras & strNumero(curNumero)
If curNumero = 1# And blnO_Final Then
strNumLetras = strNumLetras & "O"
End If
If dblCentavos > 0# Then
strNumLetras = Trim(strNumLetras) & " CON " &
Format$(CInt(dblCentavos * 100#), "00") & "/100"
End If
NroEnLetras = strNumLetras
Exit Function
End If
End If

If curNumero > 0# Then
strNumLetras = strNumLetras & strNumero(curNumero)
If curNumero = 1# And blnO_Final Then
strNumLetras = strNumLetras & "O"
End If
End If

If dblCentavos > 0# Then
strNumLetras = strNumLetras & " CON " + Format$(CInt(dblCentavos *
100#), "00") & "/100"
End If

NroEnLetras = IIf(blnNegativo, "(" & strNumLetras & ")", strNumLetras)
End Function


"Noelia" escribió:

> Hola:
> Tengo un inconveniente , como puedo colocar en una celda el importe en
> letras de un numero que se encuentra en otra celda
> Gracias
> Noe
email Siga el debate Respuesta Responder a este mensaje
Ads by Google
Help Hacer una preguntaRespuesta Tengo una respuesta
Search Busqueda sugerida