Option
Explicit
Sub
ChkIt(rngInput
As
Range)
Const
C_NAME
As
String
=
"TermineTransporter"
On
Error
GoTo
iError
If
rngInput =
""
Then
Exit
Sub
If
rngInput.Count > 1
Then
Err.Raise 513
With
Sheets(Replace(C_NAME, rngInput.Parent.Name,
""
))
If
.UsedRange.Cells.Count < 2
Then
Err.Raise 514
If
Intersect(Columns(3), rngInput)
Is
Nothing
Then
Exit
Sub
If
.Columns(3).Find(rngInput, , -4163, 1).Offset(, -1) = rngInput.Offset(, -1)
Then
_
Call
MsgBox(
"gefunden"
& vbLf & rngInput.Text & vbLf & rngInput.Offset(, -1).Text, vbExclamation + vbOKOnly, .Name)
End
With
On
Error
GoTo
0
iError:
Select
Case
Err.Number
Case
9
Call
MsgBox(
"keine Überprüfung"
, vbExclamation + vbOKOnly,
"falsche Arbeitsmappe"
)
Case
513
Call
MsgBox(
"keine Überprüfung"
, vbExclamation + vbOKOnly,
"Mehrfachselektion"
)
Case
514
Call
MsgBox(
"keine Überprüfung"
, vbExclamation + vbOKOnly,
"ungültiges Arbeitsblatt"
)
End
Select
End
Sub