
Private Sub CommandButton2_Click() Unload UserForm4 userform1.show UserForm1.ComboBox1.SetFocus End Sub |
Private Sub CommandButton1_Click()
If TextBox1.Value = "" Then
MsgBox "Manca la data"
TextBox1.SetFocus
Exit Sub
End If
Dim nriga As Integer
nriga = 3
While Cells(nriga, 2) <> ""
nriga = nriga + 1
Wend
Sheets("Foglio1").Cells(nriga, 1) = CDate(TextBox1)
Sheets("Foglio1").Cells(nriga, 2) = TextBox2
Sheets("Foglio1").Cells(nriga, 3) = TextBox3
Sheets("Foglio1").Cells(nriga, 4) = TextBox4
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
End Sub
Private Sub CommandButton2_Click()
Dim usc As Boolean, risp As Integer
usc = True
If TextBox1.Value = "" Then
' risp = MsgBox("La txt è vuota vuoi uscire lo stesso???", 4 + 32, "Richiesta")
' If risp = vbNo Then
' Cancel = True
' TextBox2.SetFocus
' Exit Sub
' Else
Unload UserForm4
' End If
End If
End Sub |
Private Sub CommandButton1_Click()
If TextBox1.Value = "" Then
MsgBox "Manca la data"
TextBox1.SetFocus
Exit Sub
End If
If IsDate(TextBox1.Value) Then
If TextBox1.Value <> Format(DateValue(TextBox1), "dd/mm/yyyy") Then
MsgBox "Il formato deve essere: dd/mm/yyyy'"
TextBox1.Value = ""
TextBox1.SetFocus
Exit Sub
End If
Else
MsgBox "Non è una data"
TextBox1.Value = ""
TextBox1.SetFocus
Exit Sub
End If
Dim nriga As Integer
If IsDate(TextBox1) = True And TextBox2 <> "" Then
nriga = 3
While Cells(nriga, 2) <> ""
nriga = nriga + 1
Wend
Sheets("Foglio1").Cells(nriga, 1) = CDate(TextBox1)
Sheets("Foglio1").Cells(nriga, 2) = TextBox2
Sheets("Foglio1").Cells(nriga, 3) = TextBox3
Sheets("Foglio1").Cells(nriga, 4) = TextBox4
TextBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
End If
End Sub
Private Sub CommandButton2_Click()
Dim usc As Boolean, risp As Integer
usc = True
If TextBox1.Value = "" Then
' risp = MsgBox("La txt è vuota vuoi uscire lo stesso???", 4 + 32, "Richiesta")
' If risp = vbNo Then
' Cancel = True
' TextBox2.SetFocus
' Exit Sub
' Else
Unload UserForm4
' End If
End If
End Sub |
