Ich habe jetzt einen Kalender optisch entworfen. Der gleich folgende Code, funktioniert auch für den Januar, allerdings nicht für den Februar. Wäre sehr begeistert wenn mir jemand von euch sagen könnte wieso nicht :)
Vielen Dank schonmal !
Gruß
Tobi
Private Sub CommandButton1_Click()
Dim Datum, Spalte, Zeile
Dim Suche As String
Zeile = 0
Spalte = 0
Datum = InputBox("Welches Datum möchten Sie suchen ? (Eingabe in TT/MM/JJJJ)")
Datum = CDate(Datum)
Spalte = 1
Zeile = 1
Do
Zeile = Zeile + 2
Do
Spalte = Spalte + 1
Suche = Worksheets("Januar").Cells(Zeile, Spalte).Value
If Suche = Datum Then
Worksheets("Januar").Cells(Zeile, Spalte).Select
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With
Zeile = Zeile + 1
Worksheets("Januar").Cells(Zeile, Spalte).Select
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With
Exit Sub
End If
Loop Until Spalte > 8
Spalte = 1
Loop Until Zeile > 12
Spalte = 1
Zeile = 1
Do
Zeile = Zeile + 2
Do
Spalte = Spalte + 1
Suche = Worksheets("Februar").Cells(Zeile, Spalte).Value
If Suche = Datum Then
Worksheets("Februar").Cells(Zeile, Spalte).Select
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With
Zeile = Zeile + 1
Worksheets("Februar").Cells(Zeile, Spalte).Select
With Selection.Interior
.ColorIndex = 4
.Pattern = xlSolid
End With
Exit Sub
End If
Loop Until Spalte > 8
Spalte = 1
Loop Until Zeile > 12
MsgBox "Das Datum konnte nicht gefunden werden, bitte versuchen Sie es erneut !"
End Sub