Professional Documents
Culture Documents
Examen Diseño Y Programación
Examen Diseño Y Programación
Semestre: 4 Sección””U”
Nombre: Eddy Hidalgo Jiménez
End Sub
Código de impresión. PDF
Private Sub txtcan3_Change()
Sub EXPORTARPDF()
lblst3.Caption = Worksheets("data").Range("f6").Value
txtimp3.Text = Val(txtcan3.Text) * Val(Textpre3.Text) '
If Worksheets("data").Range("f6").Value >= Val(txtcan3.Text) Then
lblst3.Caption = (Worksheets("data").Range("f6").Value) - Val(txtcan3.Text) ' EXPORTARPDF Macro
Else
lblst3.Caption = "Falta" '
End If
'
If lblst3.Caption = "Falta" Then
txttotal.Text = "ERROR" RUTA_PDF = "C:\Users\HJINFORMATICS\Documents\TICKET_TIENDA_PDF.pdf"
Else
txttotal.Text = Val(txtimp1.Text) + Val(txtimp2.Text) + Val(txtimp3.Text) + NOMBRE_PDF = "TICKET_TIENDA_" & Now * 1
Val(txtimp4.Text) + Val(txtimp5.Text)
lblNumLet.Caption = "Son: " & NumLetras(Val(txttotal.Text), "sol", "soles") ChDir "C:\Users\HJINFORMATICS\Documents"
End If
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
End Sub
RUTA_PDF & NOMBRE_PDF, Quality:= _
Private Sub txtcan4_Change()
lblst4.Caption = Worksheets("data").Range("f7").Value xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
txtimp4.Text = Val(txtcan4.Text) * Val(Textpre4.Text)
If Worksheets("data").Range("f7").Value >= Val(txtcan4.Text) Then OpenAfterPublish:=True
lblst4.Caption = (Worksheets("data").Range("f7").Value) - Val(txtcan4.Text)
Else End Sub
lblst4.Caption = "Falta"
Sub PRODUCTO()
End If
If lblst4.Caption = "Falta" Then PRODUCTOS.Show
txttotal.Text = "ERROR"
Else End Sub
txttotal.Text = Val(txtimp1.Text) + Val(txtimp2.Text) + Val(txtimp3.Text) +
Val(txtimp4.Text) + Val(txtimp5.Text)
lblNumLet.Caption = "Son: " & NumLetras(Val(txttotal.Text), "sol", "soles")
End If Código De Números A Letras:
End Sub
' PASAR NUMEROS A LETRAS
Private Sub txtcan5_Change()
lblst5.Caption = Worksheets("data").Range("f8").Value 'Funcion para pasar numeros a letras
txtimp5.Text = Val(txtcan5.Text) * Val(Textpre5.Text)
If Worksheets("data").Range("f8").Value >= Val(txtcan5.Text) Then
Function NumLetras(Valor As Currency, Optional MonedaSingular
lblst5.Caption = (Worksheets("data").Range("f8").Value) - Val(txtcan5.Text)
Else As String = "", Optional MonedaPlural As String = "") As String
lblst5.Caption = "Falta"
End If Dim lyCantidad As Currency, lyCentavos As Currency, lnDigito As
If lblst5.Caption = "Falta" Then Byte, lnPrimerDigito As Byte, lnSegundoDigito As Byte,
txttotal.Text = "ERROR" lnTercerDigito As Byte, lcBloque As String, lnNumeroBloques As
Else
Byte, lnBloqueCero
txttotal.Text = Val(txtimp1.Text) + Val(txtimp2.Text) + Val(txtimp3.Text) +
Val(txtimp4.Text) + Val(txtimp5.Text)
Dim laUnidades As Variant, laDecenas As Variant, laCentenas As
lblNumLet.Caption = "Son: " & NumLetras(Val(txttotal.Text), "sol", "soles")
End If Variant, I As Variant 'Si esta como Option Explicit
End Sub
Dim ValorEntero As Long
Private Sub txtpagacon_Change()
txtvuelto.Text = Val(txtpagacon.Text) - Val(txttotal.Text) Valor = Round(Valor, 2)
End Sub
lyCantidad = Int(Valor)
ValorEntero = lyCantidad
NumLetras = lcBloque
Do Case 2
lnPrimerDigito = 0 NumLetras = lcBloque & IIf(lnBloqueCero = 3, Null, " MIL") &
NumLetras
lnSegundoDigito = 0
Case 3
lnTercerDigito = 0
NumLetras = lcBloque & IIf(lnPrimerDigito = 1 And
lcBloque = ""
lnSegundoDigito = 0 And lnTercerDigito = 0, " MILLON", "
lnBloqueCero = 0 MILLONES") & NumLetras
Select Case I NumLetras = NumLetras & " " & Format(Str(lyCentavos), "00") &
"/100 " & IIf(ValorEntero = 1, MonedaSingular, MonedaPlural)
Case 1
Case 2
Else
End If
lnSegundoDigito = lnDigito
Case 3
lnTercerDigito = lnDigito
End Select
Else
lnBloqueCero = lnBloqueCero + 1
End If
If lyCantidad = 0 Then