Option
Explicit
Private
Sub
Worksheet_Change(
ByVal
Target
As
Excel.Range)
Set
Target = Intersect(Target, Columns(
"A"
))
If
Target
Is
Nothing
Then
Exit
Sub
Dim
rngCell1
As
Excel.Range
On
Error
GoTo
SafeExit
Application.EnableEvents =
False
For
Each
rngCell1
In
Target.Cells
If
Trim$(rngCell1.Value) <>
""
Then
rngCell1.Offset(, 1).FormulaR1C1 =
"=VLOOKUP(RC[-1],Stammdaten!C[-1]:C,2,false)"
rngCell1.Offset(, 7) = Environ(
"Username"
)
rngCell1.Offset(, 8) = Format(Now(),
"DD.MM.YY"
) &
" / "
& Format(Now(),
"hh:mm"
)
rngCell1.Offset(, 1).
Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=
False
, Transpose:=
False
Application.CutCopyMode =
False
rngCell1.Offset(, 2).
Select
End
If
Next
SafeExit:
Application.EnableEvents =
True
End
Sub