I'm trying to select all charts(8) on 9 worksheets and change the number format on the axis based on a selection of a dropdown box value.
I can't seem to get the syntax right for activating the chart and changing the format
Sub LoopCharts()
Set myshapes = Worksheets("Trend").ChartObjects
For Each shp In myshapes
' MsgBox shp.Name
If shp.Name = "Chart 18" Then
shp.Select
With myshapes(shp).Axes(xlCategory)
Selection.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
ActiveWindow.Visible = False
End With
End If
Next
End Sub
I can't seem to get the syntax right for activating the chart and changing the format
Sub LoopCharts()
Set myshapes = Worksheets("Trend").ChartObjects
For Each shp In myshapes
' MsgBox shp.Name
If shp.Name = "Chart 18" Then
shp.Select
With myshapes(shp).Axes(xlCategory)
Selection.Axes(xlValue).Select
Selection.TickLabels.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
ActiveWindow.Visible = False
End With
End If
Next
End Sub