Can someone modify this for another situation for me please?

danimal

New Member
Joined
Mar 29, 2005
Messages
10
Sub CopyTitle()

Dim chtChart As Chart

On Error Resume Next
For Each chtChart In ActiveWorkbook.Charts
chtChart.ChartTitle.Characters.Text = "Multiplication Form C"
Next chtChart

End Sub

-------------------

Instead of copying a chart title into each chart, I need to change the minimum and maximum values on both the axis and secondary axis.

Any help is appreciated. Thanks
 

Some videos you may like

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.

dave3009

Well-known Member
Joined
Jun 23, 2006
Messages
7,002
Office Version
  1. 365
  2. 2016
Did you check what the macro recorder noted. Perhaps by running it whilst modifying your chart it might give you a hint?

Hope this helps


Dave
 

danimal

New Member
Joined
Mar 29, 2005
Messages
10
Will this work?

Sub minmaxaxisvalues()

Dim chtChart As Chart

On Error Resume Next
For Each chtChart In ActiveWorkbook.Charts
chtChart.Axes(xlValue).MinimumScale = 0
chtChart.Axes(xlValue).MaximumScale = 64
chtChart.Axes(xlValue, xlSecondary).MaximumScale = 3
Next chtChart

End Sub
 

Watch MrExcel Video

Forum statistics

Threads
1,113,862
Messages
5,544,726
Members
410,630
Latest member
JFORTH97
Top