hi all
I use this macro to connect primary axis chart Minimum & Maximum & Major Units to cell value.
I need your help to connect the secondary axis values to the same primary axis value using this macro
Option Explicit
Sub ChartMinMax()
Sheet3.Unprotect Password:="1a"
Dim iChart As Long
Dim nCharts As Long
nCharts = Sheets("Tr").ChartObjects.Count
For iChart = 1 To nCharts
With ActiveSheet.ChartObjects(iChart).Chart
.Axes(xlValue).MaximumScale = Sheets("Tr").Range("i6").Value
.Axes(xlValue).MinimumScale = Sheets("Tr").Range("i5").Value
.Axes(xlValue).MajorUnit = Sheets("Tr").Range("i10").Value
.Axes(xlValue).MinorUnit = Sheets("Tr").Range("i10").Value
Sheet3.Protect Password:="1a", AllowFiltering:=True
End With
Next
End Sub
Private Sub Worksheet_Calculate()
ChartMinMax
End Sub
I use this macro to connect primary axis chart Minimum & Maximum & Major Units to cell value.
I need your help to connect the secondary axis values to the same primary axis value using this macro
Option Explicit
Sub ChartMinMax()
Sheet3.Unprotect Password:="1a"
Dim iChart As Long
Dim nCharts As Long
nCharts = Sheets("Tr").ChartObjects.Count
For iChart = 1 To nCharts
With ActiveSheet.ChartObjects(iChart).Chart
.Axes(xlValue).MaximumScale = Sheets("Tr").Range("i6").Value
.Axes(xlValue).MinimumScale = Sheets("Tr").Range("i5").Value
.Axes(xlValue).MajorUnit = Sheets("Tr").Range("i10").Value
.Axes(xlValue).MinorUnit = Sheets("Tr").Range("i10").Value
Sheet3.Protect Password:="1a", AllowFiltering:=True
End With
Next
End Sub
Private Sub Worksheet_Calculate()
ChartMinMax
End Sub