APechaitis
New Member
- Joined
- Jun 4, 2008
- Messages
- 6
I am trying to format a chart in excel using VB. I would like to be able to format the axes of the chart based on a cell value -- the X-axis value is in cell "chart1info!$B$4" and the Y-axis value is in "chart1info!$C$4" for instance.
I tried recording a macro for formatting the axes and got this:
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "FI vs Sparkle"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "FI"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "sparkle"
Is there a way to update the axis to reflect the values in these cells? Any help would be appreciated. Also, any general pointers toward other threads involving VB and charting in excel would be helpful.
FYI, I am currently using Excel 2000 at home, and Excel 2003 at work, I would like the solution to work in both systems, if possible.
Thank you
I tried recording a macro for formatting the axes and got this:
With ActiveChart
.HasTitle = True
.ChartTitle.Characters.Text = "FI vs Sparkle"
.Axes(xlCategory, xlPrimary).HasTitle = True
.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "FI"
.Axes(xlValue, xlPrimary).HasTitle = True
.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "sparkle"
Is there a way to update the axis to reflect the values in these cells? Any help would be appreciated. Also, any general pointers toward other threads involving VB and charting in excel would be helpful.
FYI, I am currently using Excel 2000 at home, and Excel 2003 at work, I would like the solution to work in both systems, if possible.
Thank you