Gruppe
Ereignis
Problem
Nach Eingabe der Raumnummer soll geprüft werden, ob der Raum zum vorgesehenen Zeitraum frei ist.
ClassModule: Tabelle1
Private Sub Worksheet_Change(ByVal Target As Range)
Dim iRow As Integer, iRowL As Integer
If Target.Column <> 3 Then Exit Sub
If IsEmpty(Target) Then Exit Sub
iRowL = Cells(Rows.Count, 1).End(xlUp).Row
For iRow = 2 To iRowL
If iRow <> Target.Row Then
If Cells(iRow, 2) = Cells(Target.Row, 2) And _
Cells(iRow, 3) = Cells(Target.Row, 3) Then
MsgBox "Sorry, schon belegt!"
Target.ClearContents
End
End If
End If
Next iRow
End Sub