Sub CommandButton1_Click()
If ComboBox1.Text = "" Then
MsgBox "Campo Destinazione Linea obbligatorio !!!", vbExclamation, "ATTENZIONE !!!"
ComboBox1.SetFocus
Exit Sub
End If
If TextBox2.Text = "" Then
MsgBox "Campo Codice obbligatorio !!!", vbExclamation, "ATTENZIONE !!!"
TextBox2.SetFocus
Exit Sub
End If
If TextBox3.Text = "" Then
MsgBox "Campo Prodotto obbligatorio !!!", vbExclamation, "ATTENZIONE !!!"
TextBox2.SetFocus
Exit Sub
End If
' --------------- continua
Sheets("Dosaggi").Visible = True
Sheets("Dosaggi").Activate
Dim iRow As Integer
iRow = 3
While Cells(iRow, 1).Value <> ""
iRow = iRow + 1
Wend
Cells(iRow, 1) = ComboBox1
Cells(iRow, 2) = TextBox2
Cells(iRow, 3) = TextBox3
Cells(iRow, 4) = TextBox4
Cells(iRow, 5) = TextBox5
Cells(iRow, 6) = TextBox6
Cells(iRow, 7) = TextBox7
Cells(iRow, 8) = TextBox8
Cells(iRow, 9) = TextBox9
Cells(iRow, 10) = TextBox10
Cells(iRow, 11) = TextBox11
Cells(iRow, 12) = TextBox12
Cells(iRow, 13) = TextBox13
Cells(iRow, 14) = TextBox14
Cells(iRow, 15) = TextBox15
Cells(iRow, 16) = TextBox16
Cells(iRow, 17) = TextBox17
Cells(iRow, 18) = TextBox18
Cells(iRow, 19) = TextBox19
Cells(iRow, 20) = TextBox20
Cells(iRow, 21) = TextBox21
Cells(iRow, 22) = TextBox22
' -------------- continua
ComboBox1 = ""
TextBox2 = ""
TextBox3 = ""
TextBox4 = ""
TextBox5 = ""
TextBox6 = ""
TextBox7 = ""
TextBox8 = ""
TextBox9 = ""
TextBox10 = ""
TextBox11 = ""
TextBox12 = ""
TextBox13 = ""
TextBox14 = ""
TextBox15 = ""
TextBox16 = ""
TextBox17 = ""
TextBox18 = ""
TextBox19 = ""
TextBox20 = ""
TextBox21 = ""
TextBox22 = ""
Unload Me
Sheets("Rev1").Activate
' MsgBox
MsgBox "NUOVO PRODOTTO INSERITO CON SUCCESSO", vbInformation, " REV1"
'Crea_Pulsante
'
ActiveSheet.Buttons.Add(987.75, 178.5, 202.5, 41.25).Select
Selection.ShapeRange.LockAspectRatio = msoFalse
Selection.ShapeRange.Height = 28.5
Selection.ShapeRange.Width = 198.75
'
' Apri_modulo_Rev1
Application.Goto Reference:="Nuovo_Rev1_1"
End Sub |