Sub
Lineare_Analyse()
Dim
wscounter
As
Integer
Dim
ws
As
Integer
Dim
b
As
Variant
Dim
v
As
Variant
Dim
vmax
As
Variant
wscounter = Worksheets.Count
For
ws = 2
To
wscounter
Set
wks = Worksheets(ws)
wks.Activate
LetzteZeile = wks.Cells(Rows.Count, 8).
End
(xlUp).Row
b = Application.WorksheetFunction.LinEst(Range(
"H2:H"
& LetzteZeile))
v = Application.WorksheetFunction.LinEst(Range(
"J2:J"
& LetzteZeile))
vmax = Application.WorksheetFunction.LinEst(Range(
"K2:K"
& LetzteZeile))
wks.Range(
"A"
& LetzteZeile + 17).Value = b(1)
wks.Range(
"G"
& LetzteZeile + 17).Value = v(1)
wks.Range(
"M"
& LetzteZeile + 17).Value = vmax(1)
wks.Range(
"B"
& LetzteZeile + 17).Value = b(2)
wks.Range(
"H"
& LetzteZeile + 17).Value = v(2)
wks.Range(
"N"
& LetzteZeile + 17).Value = vmax(2)
Next
End
Sub