Formulacion Numero Texto Macro
-
Upload
alex-bernardo -
Category
Documents
-
view
218 -
download
0
Transcript of Formulacion Numero Texto Macro
![Page 1: Formulacion Numero Texto Macro](https://reader030.fdocuments.es/reader030/viewer/2022021118/577c78281a28abe0548efa93/html5/thumbnails/1.jpg)
7/25/2019 Formulacion Numero Texto Macro
http://slidepdf.com/reader/full/formulacion-numero-texto-macro 1/4
Dim Texto
Dim Millones
Dim Miles
Dim Cientos
Dim Decimales
Dim CadenaDim CadMillones
Dim CadMiles
Dim CadCientos
Texto = Numero
Texto = FormatNumber(Texto, 2)
Texto = Right(Sace(!") # Texto, !")
Millones = Mid(Texto, !, $)
Miles = Mid(Texto, %, $)
Cientos = Mid(Texto, &, $)
Decimales = Mid(Texto, !$, 2)
CadMillones = Con'ierteCira(Millones, !)CadMiles = Con'ierteCira(Miles, !)
CadCientos = Con'ierteCira(Cientos, )
* Trim(CadMillones) + Then
* Trim(CadMillones) = -N Then
Cadena = CadMillones # M*../N
0lse
Cadena = CadMillones # M*../N0S
0nd *
0nd *
* Trim(CadMiles) + Then
Cadena = Cadena # # CadMiles # M*.
0nd *
* Trim(CadMiles # CadCientos) = -N Then
Cadena = Cadena # -N/ C/N # Decimales # 1!
0lse
* Miles # Cientos = Then
Cadena = Cadena # # Trim(CadCientos) # -0T34.0S C/N # Decimales #
1!
0lse
Cadena = Cadena # # Trim(CadCientos) # -0T34.0S C/N # Decimales #
1!0nd *
0nd *
Num5texto = Trim(Cadena)
0nd Function
Function Con'ierteCira(Texto, S6)
Dim Centena
Dim Decena
Dim -nidad
Dim txtCentena
Dim txtDecenaDim txt-nidad
![Page 2: Formulacion Numero Texto Macro](https://reader030.fdocuments.es/reader030/viewer/2022021118/577c78281a28abe0548efa93/html5/thumbnails/2.jpg)
7/25/2019 Formulacion Numero Texto Macro
http://slidepdf.com/reader/full/formulacion-numero-texto-macro 2/4
Centena = Mid(Texto, !, !)
Decena = Mid(Texto, 2, !)
-nidad = Mid(Texto, $, !)
Select Case Centena
Case !
txtCentena = C*0N* Decena # -nidad 7+ Then
txtCentena = C*0NT/
0nd *
Case 2
txtCentena = D/SC*0NT/S
Case $
txtCentena = TR0SC*0NT/S
Case "
txtCentena = C-4TR/C*0NT/S
Case %
txtCentena = -*N*0NT/SCase 8
txtCentena = S0*SC*0NT/S
Case 9
txtCentena = S0T0C*0NT/S
Case :
txtCentena = /C;/C*0NT/S
Case &
txtCentena = N/<0C*0NT/S
0nd Select
Select Case Decena
Case !
txtDecena = D*03
Select Case -nidad
Case !
txtDecena = /NC0
Case 2
txtDecena = D/C0
Case $
txtDecena = TR0C0
Case "
txtDecena = C4T/RC0Case %
txtDecena = -*NC0
Case 8
txtDecena = D*0C*S0*S
Case 9
txtDecena = D*0C*S*0T0
Case :
txtDecena = D*0C*/C;/
Case &
txtDecena = D*0C*N-0<0
0nd SelectCase 2
![Page 3: Formulacion Numero Texto Macro](https://reader030.fdocuments.es/reader030/viewer/2022021118/577c78281a28abe0548efa93/html5/thumbnails/3.jpg)
7/25/2019 Formulacion Numero Texto Macro
http://slidepdf.com/reader/full/formulacion-numero-texto-macro 3/4
txtDecena = <0*NT0
* -nidad 7+ Then
txtDecena = <0*NT*
0nd *
Case $
txtDecena = TR0*NT4* -nidad 7+ Then
txtDecena = TR0*NT4
0nd *
Case "
txtDecena = C-4R0NT4
* -nidad 7+ Then
txtDecena = C-4R0NT4
0nd *
Case %
txtDecena = C*NC-0NT4
* -nidad 7+ ThentxtDecena = C*NC-0NT4
0nd *
Case 8
txtDecena = S0S0NT4
* -nidad 7+ Then
txtDecena = S0S0NT4
0nd *
Case 9
txtDecena = S0T0NT4
* -nidad 7+ Then
txtDecena = S0T0NT4
0nd *
Case :
txtDecena = /C;0NT4
* -nidad 7+ Then
txtDecena = /C;0NT4
0nd *
Case &
txtDecena = N/<0NT4
* -nidad 7+ Then
txtDecena = N/<0NT4 0nd *
0nd Select
* Decena 7+ ! Then
Select Case -nidad
Case !
* S6 Then
txt-nidad = -N
0lse
txt-nidad = -N/
0nd *
Case 2txt-nidad = D/S
![Page 4: Formulacion Numero Texto Macro](https://reader030.fdocuments.es/reader030/viewer/2022021118/577c78281a28abe0548efa93/html5/thumbnails/4.jpg)
7/25/2019 Formulacion Numero Texto Macro
http://slidepdf.com/reader/full/formulacion-numero-texto-macro 4/4
Case $
txt-nidad = TR0S
Case "
txt-nidad = C-4TR/
Case %
txt-nidad = C*NC/Case 8
txt-nidad = S0*S
Case 9
txt-nidad = S*0T0
Case :
txt-nidad = /C;/
Case &
txt-nidad = N-0<0
0nd Select
0nd *
Con'ierteCira = txtCentena # # txtDecena # txt-nidad0nd Function