Dim bln As Boolean
Private Sub lstValues_Change()
Dim iRow As Integer, iCount As Integer
Dim sTxt As String
If bln Then
bln = False
Exit Sub
End If
sTxt = lstValues.List(lstValues.ListIndex, 0)
For iRow = 0 To lstValues.ListCount - 1
If lstValues.Selected(iRow) Then
iCount = iCount + 1
If iCount = 2 Then Exit For
End If
Next iRow
If iCount < 1 Then
For iRow = 0 To lstValues.ListCount - 1
If iRow <> lstValues.ListIndex Then
If lstValues.Selected(iRow) And CStr(lstValues.List(iRow, 0)) <> sTxt Then
MsgBox "Es dürfen nur Datensätze eines Datums ausgewählt werden!"
bln = True
lstValues.Selected(lstValues.ListIndex) = False
Exit For
End If
End If
Next iRow
End If
End Sub