Hi,
I'm looking to change the format of the Y axis numbers in a graph based on a number in a cell on the sheet.
So basically:
If value in cell C3 = 1 then format should be "#.##0,00" (just a number with 2 decimals)
If value in cell C3 = 2 then format should be "mm:ss,00"
If value in cell C3 = 3 then format should be "hh:mm:ss
What I was thinking with VBA was the following:
If Range("C3").Value = 1 Then
ActiveSheet.ChartObjects("Grafiek 8").Selection.TickLabels.NumberFormat = "#.##0,00"
ElseIf Range("C3").Value = 2 Then
ActiveSheet.ChartObjects("Grafiek 8").Selection.TickLabels.NumberFormat = "mm:ss,00"
ElseIf Range("C3").Value = 3 Then
ActiveSheet.ChartObjects("Grafiek 8").Selection.TickLabels.NumberFormat = "uu:mm:ss"
But this doesn't seem to work.
Anyone an idea how to make this work? The input of this graph is changing, so that's why I would like the axis to change also.
Thanks!
I'm looking to change the format of the Y axis numbers in a graph based on a number in a cell on the sheet.
So basically:
If value in cell C3 = 1 then format should be "#.##0,00" (just a number with 2 decimals)
If value in cell C3 = 2 then format should be "mm:ss,00"
If value in cell C3 = 3 then format should be "hh:mm:ss
What I was thinking with VBA was the following:
If Range("C3").Value = 1 Then
ActiveSheet.ChartObjects("Grafiek 8").Selection.TickLabels.NumberFormat = "#.##0,00"
ElseIf Range("C3").Value = 2 Then
ActiveSheet.ChartObjects("Grafiek 8").Selection.TickLabels.NumberFormat = "mm:ss,00"
ElseIf Range("C3").Value = 3 Then
ActiveSheet.ChartObjects("Grafiek 8").Selection.TickLabels.NumberFormat = "uu:mm:ss"
But this doesn't seem to work.
Anyone an idea how to make this work? The input of this graph is changing, so that's why I would like the axis to change also.
Thanks!