Private Sub CommandButton1_Click()
If ComboBox1.Text = "" Then
MsgBox "Campo Macchina obbligatorio !!!", vbOKOnly, "Richiesta"
ComboBox1.SetFocus
Exit Sub
End If
If ComboBox2.Text = "" Then
MsgBox "Campo Operatore obbligatorio !!!", vbOKOnly, "Richiesta"
ComboBox2.SetFocus
Exit Sub
End If
If ComboBox3.Text = "" Then
MsgBox "Campo Ore obbligatorio !!!", vbOKOnly, "Richiesta"
ComboBox3.SetFocus
Exit Sub
End If
' --------------- continua
Sheets("statistiche").Visible = True
Sheets("statistiche").Activate
Dim iRow As Integer
iRow = 3
While Cells(iRow, 1).Value <> ""
iRow = iRow + 1
Wend
Cells(iRow, 1) = ComboBox1
Cells(iRow, 2) = ComboBox2
Cells(iRow, 3) = ComboBox3
' -------------- continua
ComboBox1 = ""
ComboBox2 = ""
ComboBox3 = ""
Sheets("compila").Select
Range("A1").Select
End Sub |