
Dim irisposta As Integer
irisposta = MsgBox("Confermi la registrazione del Versamento di €" _
& " " & TextBox3.Value & " ?", vbYesNo)
If irisposta = vbYes Then
'
Range("b1").Value = "-"
Range("b1").End(xlDown).Offset(1, 0).Select
ActiveCell.Value = TextBox2
ActiveCell.Offset(0, 1).Value = TextBox3
ActiveCell.Offset(0, 3).Value = TextBox4
MsgBox "Ok Capo, eseguito!"
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
End If
End Sub |
Range("A1") = Format(TextBox1, "#,##0.00")
|
ActiveCell.Offset(0, 1).Select ActiveCell.NumberFormat = "#,##0.00" ActiveCell.FormulaLocal = TextBox3.Value ActiveCell.Offset(0, 3).Select ActiveCell.NumberFormat = "#,##0.00" ActiveCell.FormulaLocal = TextBox4.Value |
Private Sub Inserisci_Click()
If TextBox2 = "" Then
MsgBox "Devi Inserire l'importo del Prelievo"
TextBox2.SetFocus
Else
If Mid(TextBox2, 3, 1) <> "/" Or Mid(TextBox2, 6, 1) <> "/" Then
MsgBox "Prima di Chiudere Devi: Scrivere la Data del prelievo come: 00/00/00", 0 + 16, "ATTENZIONE:"
O_F_PREL.TextBox2.SetFocus
Else
If IsNumeric(TextBox3) = False Then
MsgBox "Prima di Chiudere Devi: Inserire l'importo del Prelievo", 0 + 16, "ATTENZIONE:"
O_F_PREL.TextBox3.SetFocus
Else
Dim irisposta As Integer
irisposta = MsgBox("Confermi la registrazione del Prelievo di €" _
& " " & TextBox3.Value & " ?", vbYesNo)
If irisposta = vbYes Then
'
Range("C6").Value = "-"
Range("C6").End(xlDown).Offset(1, 0).Select
ActiveCell.Value = TextBox2
ActiveCell.Offset(0, 1).Select
ActiveCell.NumberFormat = "#,##0.00"
ActiveCell.FormulaLocal = TextBox3.Value
ActiveCell.Offset(0, 1).Value = TextBox4
MsgBox "Ok Capo, eseguito!"
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
End If
End If
End If
End If
End Sub |
On Error Resume Next X = Len(TextBox2) Y = LTrim(TextBox2.Text) D = TextBox2 If D = "" Then Exit Sub End If If Left(D, 2) > 31 Then MsgBox "GIORNO ERRATO", vbCritical, "DATA" TextBox2.SelStart = 0 TextBox2.SelLength = Len(TextBox2) TextBox2.SetFocus Exit Sub End If If X = 2 Then TextBox2 = Y & "/" If X = 4 Then Exit Sub If Mid(D, 4, 2) = "" Then Exit Sub If Mid(D, 4, 2) > 12 Then MsgBox "MESE ERRATO", vbCritical, "DATA" TextBox2.SelStart = 3 TextBox2.SelLength = Len(TextBox2) TextBox2.SetFocus Exit Sub End If E = Left(D, 2) f = Mid(D, 4, 2) Select Case f Case "02" If E > 29 Then GoTo mess Case "04", "06", "09", "11" If E > 30 Then GoTo mess End Select If X = 5 Then TextBox2 = Y & "/" Exit Sub End If If X = 6 Then Exit Sub If X = 7 Then Exit Sub If X = 8 Then Exit Sub If X = 9 Then Exit Sub G = Mid(D, 7, 4) If G <= 1899 Or G >= 2101 Then MsgBox "L'anno deve essere tra il 1900 ed il 2100", vbCritical, "DATA" TextBox2.SelStart = 6 TextBox2.SelLength = Len(TextBox2) TextBox2.SetFocus Exit Sub End If If IsDate(TextBox2) = False Then MsgBox "La data non è valida - Controllare mese, giorno e anno", vbCritical, "DATA" TextBox2.SelStart = 0 TextBox2.SelLength = Len(TextBox2) TextBox2.SetFocus Exit Sub End If 'QUI PUOI UNA VOLTA CHE HAI SCRITTO LA DATA 'PASSARE IL COMANDO AD UN ALTRO TASTO 'DEVI SOSTITUIRE AL POSTO DI EXIT SUB ' UN ALTRO COMANDO If X = 10 Then Exit Sub End If Exit Sub mess: MsgBox "GIORNO ERRATO", vbCritical, "DATA" TextBox2.SelStart = 0 TextBox2.SelLength = Len(TextBox2) TextBox2.SetFocus Set X = Nothing Set Y = Nothing Set D = Nothing Set E = Nothing Set f = Nothing Set G = Nothing Resume |
ActiveCell.Offset(0, 1).Select ActiveCell.NumberFormat = "#,##0.00" ActiveCell.FormulaLocal = TextBox3.Value ActiveCell.Offset(0, 3).Select ActiveCell.NumberFormat = "-#,##0.00" ActiveCell.FormulaLocal = TextBox4.Value |
