Option
Explicit
Sub
Test()
Dim
strText
As
String
strText =
"186 MUSTERMANN Max 01.01.2023-01.02.2023"
Dim
vntValues
As
Variant
vntValues = Split(strText,
" "
)
With
Worksheets(
"Tabelle1"
)
Dim
rngCell
As
Excel.Range
Set
rngCell = .Columns(
"A"
).Find( _
What:=vntValues(0), _
LookIn:=xlValues, _
LookAt:=xlWhole, _
SearchOrder:=xlByColumns, _
MatchCase:=
False
)
If
rngCell
Is
Nothing
Then
Call
MsgBox(
"Kein Treffer!"
, vbExclamation)
Exit
Sub
End
If
.Cells(rngCell.Row,
"B"
).Value = vntValues(1)
.Cells(rngCell.Row,
"C"
).Value = vntValues(2)
.Cells(rngCell.Row,
"I"
).Value = vntValues(3)
End
With
Call
MsgBox(
"Fertsch."
, vbInformation)
End
Sub