Results 1 to 16 of 16

Thread: Cut and Paste macro in Excel not changing trendline values

Threaded View

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2005
    Posts
    11

    Cut and Paste macro in Excel not changing trendline values

    I am trying to figure out a way around a bug in Excel. I have a table with values that are changing regularly and a graph based on those table values. I set up a macro to cut and paste the values of the trendline function in the graph, modify it and work it into other functions. The only problem is that when the macro runs, it reposts the same function every time. I'll post the code below:

    VB Code:
    1. Sub calculateVO2()
    2. '
    3. ' calculateVO2 Macro
    4. ' Macro recorded 9/15/2005 by Bill Steele
    5. '
    6. ' Keyboard Shortcut: Ctrl+Shift+Z
    7. '
    8.     ActiveSheet.ChartObjects("Chart 3").Activate
    9.     ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Select
    10.     ActiveWindow.Visible = False
    11.     Windows("tinman-20 mile calculator.xls").Activate
    12.     ActiveCell.Select
    13.    ActiveCell.FormulaR1C1 = _
    14.         [I]"= 0.000822294662032708*RC[1]^6 - 0.266599848942608*RC[1]^5 + 35.8848498068709*RC[1]^4 - 2566.84446514638*RC[1]^3 + 102912.819753766*RC[1]^2 - 2192977.28925606*RC[1]^1 + 19406383.8609026"[/I]
    15.     ActiveCell.Select
    16.     ActiveCell.GoalSeek Goal:=420, ChangingCell:=ActiveCell.Offset(0, 1).Range( _
    17.         "A1")
    18. End Sub

    Above the italicized part is what I am trying to make variable with each macro execution. Is there a way this can be done? For whatever reason, it either gives me an error or reposts the same data.

    Thanks,

    Will
    Last edited by RobDog888; Sep 16th, 2005 at 07:23 PM. Reason: Added vbcode tags

Posting Permissions

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



Click Here to Expand Forum to Full Width