Option
Explicit
Sub
Verbessert()
Dim
rngSummary
As
Excel.Range
With
Worksheets(
"Zusammenfassung Ergebnisse"
)
Set
rngSummary = .Range(
"C5:C"
& .Range(
"C"
& .Rows.Count).
End
(xlUp).Row)
If
rngSummary.Row < 5
Then
Set
rngSummary =
Nothing
End
With
Dim
rngControl
As
Excel.Range
With
Worksheets(
"Steuerungstabelle"
)
Set
rngControl = .Range(
"D5:AE"
& .Range(
"D"
& .Rows.Count).
End
(xlUp).Row)
If
rngControl.Row < 5
Then
Set
rngControl =
Nothing
End
With
If
rngSummary
Is
Nothing
_
Or
rngControl
Is
Nothing
_
Then
Exit
Sub
End
If
rngSummary.Formula =
"=VLOOKUP($A5,"
& rngControl.Address(
True
,
True
, External:=
True
) &
", 2, FALSE)"
rngSummary.Value = rngSummary.Value
End
Sub