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:
Sub calculateVO2() ' ' calculateVO2 Macro ' Macro recorded 9/15/2005 by Bill Steele ' ' Keyboard Shortcut: Ctrl+Shift+Z ' ActiveSheet.ChartObjects("Chart 3").Activate ActiveChart.SeriesCollection(1).Trendlines(1).DataLabel.Select ActiveWindow.Visible = False Windows("tinman-20 mile calculator.xls").Activate ActiveCell.Select ActiveCell.FormulaR1C1 = _ [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] ActiveCell.Select ActiveCell.GoalSeek Goal:=420, ChangingCell:=ActiveCell.Offset(0, 1).Range( _ "A1") 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




Reply With Quote