habe mal wieder ein Problem!
Habe in einer UserForm 3 ComboBoxen erstellt, welche mein Datum anzeigen sollen! Wobei ich es nicht schaffe, dass in den Boxen 1 als 01 , 2 als 02 erscheint!
Mein Makro:
Dim I As Integer
For I = 1 To 31
ComboBox2.AddItem (I)
Next
Dim K As Integer
For K = 1 To 12
ComboBox3.AddItem (K)
Next
Dim J As Integer
For J = 2002 To 2050
ComboBox4.AddItem (J)
Next
Ich habe versucht die Ausgabe über ein Makro zu programmieren, aber immer wenn ich das Programm laufen lasse und dabei nichts eintrage kommt immer ein Unverträglichkeitsfehler.
Hier mein Programm: ComboBox2 = Tag
ComboBox3 = Monat
ComboBox4 = Jahr
With Sheets("1 Integrity")
If ComboBox2 = "" And ComboBox3 = "" And ComboBox4 = "" Then
MsgBox ("Bitte Prüfdatum eingeben!!")
End If
If ComboBox2.Value < 10 And ComboBox3.Value > 9 Then
Cells(3, 5).Value = "0" + ComboBox2.Value + "." + ComboBox3.Value + "." + ComboBox4.Value
End If
If ComboBox2.Value > 9 And ComboBox3 < 10 Then
Cells(3, 5).Value = ComboBox2.Value + ".0" + ComboBox3.Value + "." + ComboBox4.Value
End If
If ComboBox2.Value < 10 And ComboBox3.Value < 10 Then
Cells(3, 5).Value = "0" + ComboBox2.Value + ".0" + ComboBox3.Value + "." + ComboBox4.Value
End If
If ComboBox2.Value > 9 And ComboBox3.Value > 9 Then
Cells(3, 5).Value = ComboBox2.Value + "." + ComboBox3.Value + "." + ComboBox4.Value
End If
Kann mir jetzt jemand sagen, was an meinem Makro falsch ist, oder wie die Daten in meine ComboBox eintragen lassen kann!!
Danke!
Gruss Chris