Option
Explicit
Private
Sub
Worksheet_Change(
ByVal
Target
As
Range)
Dim
KeyCells
As
Range
Dim
i
As
Long
Set
KeyCells = Sheets(
"VEP2 Fahrspiel"
).Range(
"D2:J15"
)
If
Not
Application.Intersect(KeyCells, Range(Target.Address))
Is
Nothing
Then
Application.ScreenUpdating =
False
Application.EnableEvents =
False
For
i = 5
To
7
Call
Fahrtzeit(Worksheets(
"Tabelle"
& i))
Call
Restbeschleunigung(Worksheets(
"Tabelle"
& i))
Next
Application.EnableEvents =
True
Application.ScreenUpdating =
True
End
If
End
Sub
Public
Sub
Restbeschleunigung(Worksheet
As
Excel.Worksheet)
Dim
x
As
Long
With
Worksheet
x = 2
Do
While
.Cells(x, 3).Value < .Cells(10, 19).Value
x = x + 1
If
x > 10003
Then
Exit
Do
Loop
If
x < 10003
Then
.Cells(31, 17).Value = Round(.Cells(x - 1, 6), 2)
Else
.Cells(31, 17).Value = 0
End
If
End
With
End
Sub
Public
Sub
Fahrtzeit(Worksheet
As
Excel.Worksheet)
Dim
x
As
Long
With
Worksheet
x = 3
Do
While
.Cells(x, 3).Value = 0
x = x + 1
Loop
.Cells(32, 17).Value = .Cells(x, 1).Value
End
With
End
Sub