Option Explicit
Private Sub ComboBox1_Change()
Me.ComboBox1.Value = "_" <===========
End Sub
Private Sub ComboBox2_Change()
Me.ComboBox2.Value = "_"
End Sub
Private Sub ComboBox3_Change()
Me.ComboBox3.Value = "_"
End Sub
Private Sub ComboBox4_Change()
End Sub
Private Sub ComboBox5_Change()
End Sub
Private Sub ComboBox6_Change()
End Sub
Private Sub CommandButton1_Click()
Dim rng1 As Range, rng2 As Range, cells As Range, rng3 As Range, c As Range
'Dim giorno As String
'giorno = Left(ComboBox3, 3)
'giorno = ComboBox3
Set rng1 = Sheets("elenco").[H3:H25] 'originale
Range("A1").End(xlUp).Select 'originale
ActiveCell.Offset(1).Activate ' originale
For Each c In rng1
If c.Value = "" Then Exit For
If c.Value = ComboBox1.Value Then
ActiveCell.Value = c.Offset(, 1)
ActiveCell.Offset(0, 1).Value = ComboBox2.Value
ActiveCell.Offset(0, 2).Value = ComboBox3.Value
ActiveCell.Offset(0, 3).Value = ComboBox4.Value
ActiveCell.Offset(0, 4).Value = ComboBox5.Value
ActiveCell.Offset(0, 5).Value = ComboBox6.Value
End If
Next c
ComboBox1 = ""
ComboBox2 = ""
ComboBox3 = ""
ComboBox4 = ""
ComboBox5 = ""
ComboBox6 = ""
UserForm1.Hide |