Grazie cassano ma credo che l'errore era nel combobox. Ora mi trovo preò difronte ad altro problema. Posto il codice:
codice:
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
Application.ScreenUpdating = False
Dim CL As Object
If OptionButton1.Value = True Then
TextBox1 = MonthView1.Value
Data = CDate(TextBox1)
Set zona = Range(Range("U88"), Range("U88").End(xlDown))
For Each CL In zona
If CL = Data Then
TextBox2 = CL.Offset(0, 3).Value
TextBox3 = CL.Offset(0, 4).Value
TextBox4 = CL.Offset(0, 5).Value
TextBox5 = CL.Offset(0, 6).Value
ComboBox1.AddItem CL.Offset(0, 2).Value
i = i + 1
End If
Next
If i > 0 Then
MsgBox "La data è presente"
Else
MsgBox "Questa data non è presente"
End If
ElseIf OptionButton2.Value = True Then
TextBox6 = MonthView1.Value
Data = CDate(TextBox6)
Set zona = Range(Range("U88"), Range("U88").End(xlDown))
For Each CL In zona
If CL = Data Then
TextBox7 = CL.Offset(0, 3).Value
TextBox8 = CL.Offset(0, 4).Value
TextBox9 = CL.Offset(0, 5).Value
TextBox10 = CL.Offset(0, 6).Value
ComboBox2.AddItem CL.Offset(0, 2).Value
i = i + 1
End If
Next
If i > 0 Then
MsgBox "La data è presente"
Else
MsgBox "Questa data non è presente"
End If
End If
End Sub
il tutto lo devo ripetere per altri 5 option click. Posso in qualche modo risicare il codice??
Grazie per l'auito