Results 1 to 10 of 10

Regression formula

Threaded View

Romoluzzi Regression formula 12-22-2010, 07:13 AM
Romoluzzi Re: Regression formula 01-01-2011, 11:43 AM
shg Re: Regression formula 01-01-2011, 01:26 PM
MarvinP Re: Regression formula 01-01-2011, 02:18 PM
Romoluzzi Re: Regression formula 01-02-2011, 08:38 AM
DonkeyOte Re: Regression formula 01-02-2011, 08:51 AM
shg Re: Regression formula 01-02-2011, 09:06 AM
  1. #1
    Registered User
    Join Date
    09-21-2010
    Location
    Rome, Italy
    MS-Off Ver
    Excel 2003
    Posts
    36

    Cool Regression formula

    I often use regression in data analysis and produce relevant graph.
    Here's the code:

    Sub Previsioni()
    '
    If Range("D30") = 42 Then
    MsgBox "Attenzione!!! Zona dati vuota"
    End
    End If
    
    Dim Codice, Tipo, equaz
    equaz = ""
    Codice = Range("f5").Value
    Codice = Left(Codice, 1)
    
    If Codice = 1 Then
    Tipo = xlLinear
    End If
    
    If Codice = 2 Then
    Tipo = xlExponential
    End If
    
    If Codice = 3 Then
    Tipo = xlLogarithmic
    End If
    
    If Codice = 4 Then
    Tipo = xlPolynomial
    End If
    
    ActiveSheet.ChartObjects("Chart 31").Activate
    ActiveChart.ChartArea.Select
    
    ActiveChart.SeriesCollection(1).Trendlines.Add(Type:=Tipo, Forward:=0, _
    Backward:=0, DisplayEquation:=True, DisplayRSquared:=True).Select
    
    ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Select
    'equaz = ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel
    Selection.Left = 440
    Selection.Top = 273
    ActiveWindow.Visible = False
    
    'Range("Equazione").Value = ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel
    'Selection.Paste
    End Sub
    As you can see I've tried to "catch" automatically in some way the formula given by the trendlines in the graph area in order to use it for other calculations, but unsuccessful.
    Have you any hint on how this can be achieved?
    Thanks in advance for your usual precious help.
    Last edited by Romoluzzi; 01-02-2011 at 09:46 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1