1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
| For i = 0 To 6
tableau(i, 0) = "0.0E+00"
Next i
ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Select
Selection.NumberFormat = "0.0E+00"
Data = ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Text
Data = Replace(Data, "y", "")
Data = Replace(Data, " ", "")
Data= Replace(Data, "=", "")
For i = Degré To 2 Step -1
Data = Replace(Data, "x" & i & "", ";")
Next i
Data = Replace(Data, "x", ";")
Data = Replace(Data, "R2", ";")
p = Mid(Data, 16, 1)
If p = ";" Then
T = 15
Else
T = 16
End If
tableau(Degré, 0) = Left(Data, T)
Data = Replace(Data, tableau(Degré, 0) & ";", "")
j = 1
For j = 1 To Degré Step 1
tableau(Degré - j, 0) = Left(Data, 16)
Data = Replace(Data, tableau(Degré - j, 0) & ";", "")
Next j
R2 = Right(Data, 15)
ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Select
Selection.NumberFormat = "0.0+00"
Sheets("Coefficients").Select
Cells.Find(What:="x0 = ", After:=ActiveCell, LookIn:=xlFormulas, LookAt _
:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Range("A1").Value = tableau(0, 0)
ActiveCell.Offset(2, 1).Range("A1").Value = tableau(1, 0)
ActiveCell.Offset(4, 1).Range("A1").Value = tableau(2, 0)
ActiveCell.Offset(0, 3).Range("A1").Value = tableau(3, 0)
ActiveCell.Offset(2, 3).Range("A1").Value = tableau(4, 0)
ActiveCell.Offset(4, 3).Range("A1").Value = tableau(5, 0)
ActiveCell.Offset(0, 5).Range("A1").Value = tableau(6, 0)
ActiveCell.Offset(2, 5).Range("A1").Value = R2 |
Partager