Option
Explicit
Private
Sub
Worksheet_Change(
ByVal
Target
As
Excel.Range)
Dim
rngCell1
As
Range
Application.EnableEvents =
False
Select
Case
Target.Column
Case
1
If
Target
Is
Nothing
Then
Exit
Sub
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(, 8) = Format(Now(),
"DD.MM.YY"
) &
" / "
& Format(Now(),
"hh:mm"
)
End
If
Next
Case
10
If
Target
Is
Nothing
Then
Exit
Sub
For
Each
rngCell1
In
Target.Cells
If
Trim$(rngCell1.Value) <>
""
Then
rngCell1.Offset(, 1) = Format(Now(),
"DD.MM.YY"
) &
" / "
& Format(Now(),
"hh:mm"
)
End
If
Next
Case
12
If
Target
Is
Nothing
Then
Exit
Sub
For
Each
rngCell1
In
Target.Cells
If
Trim$(rngCell1.Value) <>
""
Then
rngCell1.Offset(, 1) = Format(Now(),
"DD.MM.YY"
) &
" / "
& Format(Now(),
"hh:mm"
)
End
If
Next
Case
Else
End
Select
Application.EnableEvents =
True
End
Sub