Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim strSB As String
Dim lngZeile As Long, lngLZ As Long
lngLZ = Cells(Rows.Count, 3).End(xlUp).Row
With Range(Cells(2, 1), Cells(lngLZ, 5))
.Interior.ColorIndex = xlNone
End With
If Target.Column = 3 And Target.Row > 1 Then
strSB = CDate(ActiveCell.Value)
For lngZeile = 2 To lngLZ
If Format(CDate(Cells(lngZeile, 3)), "hh") = Format(strSB, "hh") Then
Range(Cells(lngZeile, 1), Cells(lngZeile, 5)).Interior.ColorIndex = 35
Else
End If
Next lngZeile
End If
End Sub
|