Option
Explicit
Private
Sub
Worksheet_BeforeDoubleClick(
ByVal
Target
As
Range, Cancel
As
Boolean
)
Dim
strRegNo
As
String
Dim
rngZelle
As
Excel.Range
If
Target.Address =
"$D$14"
Then
strRegNo = Worksheets(
"Registernummer"
).Range(
"B2"
).Value
With
Worksheets(
"Data"
)
On
Error
Resume
Next
Set
rngZelle = .Columns(
"C"
).Find( _
What:=strRegNo, _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByColumns)
On
Error
GoTo
0
If
rngZelle
Is
Nothing
Then
Cancel =
True
Call
MsgBox(
"Kein Treffer für '"
& strRegNo &
"'."
, vbExclamation)
Exit
Sub
End
If
.Activate
.Cells(rngZelle.Row,
"AR"
).Activate
End
With
End
If
End
Sub