
If TextBox5 <= Range("F133") Then
ElseIf TextBox5.Value > Range("F133") Then
MsgBox (" NON HAI DISPONIBILITA' DI FONDI SUL CAPITOLO "), vbCritical
Else
|
Private Sub CommandButton1_Click()
Sheets("INSERIMENTO").Select
Range("a6").Select
If TextBox1 = "" Then
Beep
MsgBox "Nessun dato risulta inserito "
TextBox1.SetFocus
Exit Sub
End If
Dim nome1
nome1 = TextBox1.Value
If TextBox1 <> Empty Then
Set INTERVALLO = Range("a5:a65000")
If Application.CountIf(INTERVALLO, nome1) = 0 Then
If TextBox5.Value <= Range("F133") Then
If TextBox5.Value > Range("F133") Then
MsgBox (" NON HAI DISPONIBILITA' DI FONDI SUL CAPITOLO "), vbCritical
If Range("a6") = "" Then
ActiveCell.Value = TextBox1
ActiveCell.Offset(0, 1).Value = DateValue(TextBox2.Value)
ActiveCell.Offset(0, 2).Value = ComboBox1
'ActiveCell.Offset(0, 3).Value = ComboBox2
ActiveCell.Offset(0, 4).Value = TextBox4
'ActiveCell.Offset(0, 5).Value = TextBox5
'ActiveCell.Offset(0, 6).Value = ComboBox1
ActiveCell.Offset(0, 5).Value = CDbl(TextBox5)
ActiveCell.Offset(0, 6).Value = ComboBox8
ActiveCell.Offset(0, 7).Value = ComboBox9
ActiveCell.Offset(0, 8).Value = ComboBox12
ActiveCell.Offset(0, 9).Value = ComboBox13
Beep
MsgBox "Ok! Registrazione dato avvenuta!"
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
'ComboBox2 = Empty
TextBox4 = Empty
TextBox5 = Empty
TextBox6 = Empty
'TextBox7 = Empty
ComboBox1 = Empty
ComboBox8 = Empty
ComboBox9 = Empty
ComboBox12 = Empty
ComboBox13 = Empty
Exit Sub
End If
If Not Range("a6") = "" Then
Dim irisposta As Integer
irisposta = MsgBox(" Confermi la registrazione " _
& " di " & TextBox1.Value & " ?", vbYesNo, "Scheda Impegno Puglia")
If irisposta = vbYes Then
Sheets("INSERIMENTO").Select
Range("A6500").End(xlUp).Offset(1, 0).Select
ActiveCell.Value = TextBox1
ActiveCell.Offset(0, 1).Value = DateValue(TextBox2.Value)
ActiveCell.Offset(0, 2).Value = ComboBox1
'ActiveCell.Offset(0, 3).Value = ComboBox2
ActiveCell.Offset(0, 4).Value = TextBox4
'ActiveCell.Offset(0, 5).Value = TextBox6
'ActiveCell.Offset(0, 6).Value = ComboBox1
ActiveCell.Offset(0, 5).Value = CDbl(TextBox5)
ActiveCell.Offset(0, 6).Value = ComboBox8
ActiveCell.Offset(0, 7).Value = ComboBox9
ActiveCell.Offset(0, 8).Value = ComboBox12
ActiveCell.Offset(0, 9).Value = ComboBox13
Beep
MsgBox " OK! Registrazione dato avvenuta!", vbOKOnly, "Scheda Impegno Puglia"
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
'ComboBox2 = Empty
TextBox4 = Empty
TextBox5 = Empty
TextBox6 = Empty
'TextBox7 = Empty
ComboBox1 = Empty
ComboBox8 = Empty
ComboBox9 = Empty
ComboBox12 = Empty
ComboBox13 = Empty
End If
End If
Else
MsgBox "REGISTRAZIONE GIA' INSERITA"
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
'ComboBox2 = Empty
TextBox4 = Empty
TextBox5 = Empty
'TextBox7 = Empty
ComboBox1 = Empty
ComboBox8 = Empty
ComboBox9 = Empty
ComboBox12 = Empty
ComboBox13 = Empty
TextBox6 = Empty
End If
End If
End If
End If
Sheets("APPOGGIO").Select
'======================================
'MINUTATA
'======================================
Range("BJ2") = TextBox7 'DATA MINUTA
Range("BJ3") = ComboBox14 'MINUTATA
Range("BJ4") = ComboBox2 'MINUTATA
Range("BJ5") = ComboBox5 'DATTILOSCRITTA
Range("BJ6") = ComboBox3 'REVISORE
Range("BJ7") = ComboBox4 'REVISORE
Unload Me
userform2.Show
End Sub
|
Private Sub CommandButton1_Click()
Sheets("INSERIMENTO").Select
Range("a6").Select
If TextBox1 = "" Then
Beep
MsgBox "Nessun dato risulta inserito "
TextBox1.SetFocus
Exit Sub
End If
Dim nome1
nome1 = TextBox1.Value
If TextBox1 <> Empty Then
Set INTERVALLO = Range("a5:a65000")
If Application.CountIf(INTERVALLO, nome1) = 0 Then
If CDbl(TextBox5.Value) <= Range("F133") Then
MsgBox (" HAI DISPONIBILITA' ")
Else
If CDbl(TextBox5.Value) > Range("F133") Then
MsgBox (" NON HAI DISPONIBILITA' DI FONDI SUL CAPITOLO "), vbCritical
If Range("a6") = "" Then
ActiveCell.Value = TextBox1
ActiveCell.Offset(0, 1).Value = DateValue(TextBox2.Value)
ActiveCell.Offset(0, 2).Value = ComboBox1
'ActiveCell.Offset(0, 3).Value = ComboBox2
ActiveCell.Offset(0, 4).Value = TextBox4
'ActiveCell.Offset(0, 5).Value = TextBox5
'ActiveCell.Offset(0, 6).Value = ComboBox1
ActiveCell.Offset(0, 5).Value = CDbl(TextBox5)
ActiveCell.Offset(0, 6).Value = ComboBox8
ActiveCell.Offset(0, 7).Value = ComboBox9
ActiveCell.Offset(0, 8).Value = ComboBox12
ActiveCell.Offset(0, 9).Value = ComboBox13
Beep
MsgBox "Ok! Registrazione dato avvenuta!"
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
'ComboBox2 = Empty
TextBox4 = Empty
TextBox5 = Empty
TextBox6 = Empty
'TextBox7 = Empty
ComboBox1 = Empty
ComboBox8 = Empty
ComboBox9 = Empty
ComboBox12 = Empty
ComboBox13 = Empty
Exit Sub
End If
If Not Range("a6") = "" Then
Dim irisposta As Integer
irisposta = MsgBox(" Confermi la registrazione " _
& " di " & TextBox1.Value & " ?", vbYesNo, "Scheda Impegno Puglia")
If irisposta = vbYes Then
Sheets("INSERIMENTO").Select
Range("A6500").End(xlUp).Offset(1, 0).Select
ActiveCell.Value = TextBox1
ActiveCell.Offset(0, 1).Value = DateValue(TextBox2.Value)
ActiveCell.Offset(0, 2).Value = ComboBox1
'ActiveCell.Offset(0, 3).Value = ComboBox2
ActiveCell.Offset(0, 4).Value = TextBox4
'ActiveCell.Offset(0, 5).Value = TextBox6
'ActiveCell.Offset(0, 6).Value = ComboBox1
ActiveCell.Offset(0, 5).Value = CDbl(TextBox5)
ActiveCell.Offset(0, 6).Value = ComboBox8
ActiveCell.Offset(0, 7).Value = ComboBox9
ActiveCell.Offset(0, 8).Value = ComboBox12
ActiveCell.Offset(0, 9).Value = ComboBox13
Beep
MsgBox " OK! Registrazione dato avvenuta!", vbOKOnly, "Scheda Impegno Puglia"
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
'ComboBox2 = Empty
TextBox4 = Empty
TextBox5 = Empty
TextBox6 = Empty
'TextBox7 = Empty
ComboBox1 = Empty
ComboBox8 = Empty
ComboBox9 = Empty
ComboBox12 = Empty
ComboBox13 = Empty
End If
End If
MsgBox "REGISTRAZIONE GIA' INSERITA"
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
'ComboBox2 = Empty
TextBox4 = Empty
TextBox5 = Empty
'TextBox7 = Empty
ComboBox1 = Empty
ComboBox8 = Empty
ComboBox9 = Empty
ComboBox12 = Empty
ComboBox13 = Empty
TextBox6 = Empty
End If
End If
End If
End If
Sheets("APPOGGIO").Select
'======================================
'MINUTATA
'======================================
Range("BJ2") = TextBox7 'DATA MINUTA
Range("BJ3") = ComboBox14 'MINUTATA
Range("BJ4") = ComboBox2 'MINUTATA
Range("BJ5") = ComboBox5 'DATTILOSCRITTA
Range("BJ6") = ComboBox3 'REVISORE
Range("BJ7") = ComboBox4 'REVISORE
Unload Me
userform2.Show
End Sub
|
Private Sub CommandButton1_Click()
Dim nome1 As String
Dim irisposta As Integer
nome1 = TextBox1.Value
Sheets("INSERIMENTO").Select
Range("a6").Select
If TextBox1 = "" Then
Beep
MsgBox "Nessun dato risulta inserito "
TextBox1.SetFocus
Exit Sub
End If
If TextBox1 <> Empty Then
Set INTERVALLO = Range("a5:a65000")
If Application.CountIf(INTERVALLO, nome1) = 0 Then
If CDbl(TextBox5.Value) <= Range("F133") Then
MsgBox (" HAI DISPONIBILITA' ") '**************qui finisce il codice se HAI DISPONIBILITA'
Else
If CDbl(TextBox5.Value) > Range("F133") Then
MsgBox (" NON HAI DISPONIBILITA' DI FONDI SUL CAPITOLO "), vbCritical
If Range("a6") = "" Then
ActiveCell.Value = TextBox1
ActiveCell.Offset(0, 1).Value = DateValue(TextBox2.Value)
ActiveCell.Offset(0, 2).Value = ComboBox1
'ActiveCell.Offset(0, 3).Value = ComboBox2
ActiveCell.Offset(0, 4).Value = TextBox4
'ActiveCell.Offset(0, 5).Value = TextBox5
'ActiveCell.Offset(0, 6).Value = ComboBox1
ActiveCell.Offset(0, 5).Value = CDbl(TextBox5)
ActiveCell.Offset(0, 6).Value = ComboBox8
ActiveCell.Offset(0, 7).Value = ComboBox9
ActiveCell.Offset(0, 8).Value = ComboBox12
ActiveCell.Offset(0, 9).Value = ComboBox13
Beep
MsgBox "Ok! Registrazione dato avvenuta!"
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
'ComboBox2 = Empty
TextBox4 = Empty
TextBox5 = Empty
TextBox6 = Empty
'TextBox7 = Empty
ComboBox1 = Empty
ComboBox8 = Empty
ComboBox9 = Empty
ComboBox12 = Empty
ComboBox13 = Empty
Exit Sub
End If
If Not Range("a6") = "" Then '************questo dovrebbe essere l'Else di Range("a6") = "", sostituire la riga sopra e questa con Else
irisposta = MsgBox(" Confermi la registrazione " _
& " di " & TextBox1.Value & " ?", vbYesNo, "Scheda Impegno Puglia")
If irisposta = vbYes Then
Sheets("INSERIMENTO").Select
Range("A6500").End(xlUp).Offset(1, 0).Select
ActiveCell.Value = TextBox1
ActiveCell.Offset(0, 1).Value = DateValue(TextBox2.Value)
ActiveCell.Offset(0, 2).Value = ComboBox1
'ActiveCell.Offset(0, 3).Value = ComboBox2
ActiveCell.Offset(0, 4).Value = TextBox4
'ActiveCell.Offset(0, 5).Value = TextBox6
'ActiveCell.Offset(0, 6).Value = ComboBox1
ActiveCell.Offset(0, 5).Value = CDbl(TextBox5)
ActiveCell.Offset(0, 6).Value = ComboBox8
ActiveCell.Offset(0, 7).Value = ComboBox9
ActiveCell.Offset(0, 8).Value = ComboBox12
ActiveCell.Offset(0, 9).Value = ComboBox13
Beep
MsgBox " OK! Registrazione dato avvenuta!", vbOKOnly, "Scheda Impegno Puglia"
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
'ComboBox2 = Empty
TextBox4 = Empty
TextBox5 = Empty
TextBox6 = Empty
'TextBox7 = Empty
ComboBox1 = Empty
ComboBox8 = Empty
ComboBox9 = Empty
ComboBox12 = Empty
ComboBox13 = Empty
End If
End If
MsgBox "REGISTRAZIONE GIA' INSERITA"
TextBox1 = Empty
TextBox2 = Empty
TextBox3 = Empty
'ComboBox2 = Empty
TextBox4 = Empty
TextBox5 = Empty
'TextBox7 = Empty
ComboBox1 = Empty
ComboBox8 = Empty
ComboBox9 = Empty
ComboBox12 = Empty
ComboBox13 = Empty
TextBox6 = Empty
End If
End If
End If
End If
Sheets("APPOGGIO").Select
'======================================
'MINUTATA
'======================================
Range("BJ2") = TextBox7 'DATA MINUTA
Range("BJ3") = ComboBox14 'MINUTATA
Range("BJ4") = ComboBox2 'MINUTATA
Range("BJ5") = ComboBox5 'DATTILOSCRITTA
Range("BJ6") = ComboBox3 'REVISORE
Range("BJ7") = ComboBox4 'REVISORE
Unload Me
userform2.Show
End Sub |
MsgBox (" Non c'è Disponibilità sul capitolo, ----> QUI DEVE APPARIRE IL CAPITOLO <---- ATTENZIONE!!!!, NON PUOI PROSEGUIRE CON LA REGISTRAZIONE "), vbCritical |
