Your SlideShare is downloading. ×
Funcion numeros a texto
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Saving this for later?

Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime - even offline.

Text the download link to your phone

Standard text messaging rates apply

Funcion numeros a texto

99
views

Published on

Esta es la nomenclatura de la formula en excel para convertir numeros a texto

Esta es la nomenclatura de la formula en excel para convertir numeros a texto

Published in: Education

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
99
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Function PesosMN(tyCantidad As Currency) As String Dim lyCantidad As Currency, lyCentavos As Currency, lnDigito As Byte, lnPrimerDigito As Byte, lnSegundoDigito As Byte, lnTercerDigito As Byte, lcBloque As String, lnNumeroBloques As Byte, lnBloqueCero Dim laUnidades As Variant, laDecenas As Variant, laCentenas As Variant, I As Variant 'Si estacomo Option Explicit tyCantidad = Round(tyCantidad, 2) lyCantidad = Int(tyCantidad) lyCentavos = (tyCantidad - lyCantidad) * 100 laUnidades = Array("UN", "DOS", "TRES", "CUATRO", "CINCO", "SEIS", "SIETE", "OCHO", "NUEVE", "DIEZ", "ONCE", "DOCE", "TRECE", "CATORCE", "QUINCE", "DIECISEIS", "DIECISIETE", "DIECIOCHO", "DIECINUEVE", "VEINTE", "VEINTIUN", "VEINTIDOS", "VEINTITRES", "VEINTICUATRO", "VEINTICINCO", "VEINTISEIS", "VEINTISIETE", "VEINTIOCHO", "VEINTINUEVE") laDecenas = Array("DIEZ", "VEINTE", "TREINTA", "CUARENTA", "CINCUENTA", "SESENTA", "SETENTA", "OCHENTA", "NOVENTA") laCentenas = Array("CIENTO", "DOSCIENTOS", "TRESCIENTOS", "CUATROCIENTOS", "QUINIENTOS", "SEISCIENTOS", "SETECIENTOS", "OCHOCIENTOS", "NOVECIENTOS") lnNumeroBloques = 1 Do lnPrimerDigito = 0 lnSegundoDigito = 0 lnTercerDigito = 0 lcBloque = "" lnBloqueCero = 0 For I = 1 To 3 lnDigito = lyCantidadMod 10 If lnDigito<> 0 Then Select Case I Case 1 lcBloque = " " &laUnidades(lnDigito - 1) lnPrimerDigito = lnDigito Case 2 IflnDigito<= 2 Then lcBloque = " " &laUnidades((lnDigito * 10) + lnPrimerDigito - 1) Else lcBloque = " " &laDecenas(lnDigito - 1) &IIf(lnPrimerDigito<> 0, " Y", Null) &lcBloque EndIf lnSegundoDigito = lnDigito Case 3 lcBloque = " " &IIf(lnDigito = 1 And lnPrimerDigito = 0 And lnSegundoDigito = 0, "CIEN", laCentenas(lnDigito - 1)) &lcBloque lnTercerDigito = lnDigito EndSelect Else lnBloqueCero = lnBloqueCero + 1 End If lyCantidad = Int(lyCantidad / 10) If lyCantidad = 0 Then Exit For End If
  • 2. Next I Select Case lnNumeroBloques Case 1 PesosMN = lcBloque Case 2 PesosMN = lcBloque&IIf(lnBloqueCero = 3, Null, " MIL") &PesosMN Case 3 PesosMN = lcBloque&IIf(lnPrimerDigito = 1 AndlnSegundoDigito = 0 And lnTercerDigito = 0, " MILLON", " MILLONES") &PesosMN EndSelect lnNumeroBloques = lnNumeroBloques + 1 LoopUntillyCantidad = 0 PesosMN = "SON: (" &PesosMN&IIf(tyCantidad> 1, " PESOS ", " PESO ") &Format(Str(lyCentavos), "00") & "/100 M.N.)" EndFunction