Ticklabel problem
Hi David
Change .Axis to .Axes
I would also embrace the code with something like this
If target.address = "$C$49" then
graphtype = target.Value
or simply
Select case target.Value
'code
End if
Regards,
Peter T
"Kained" wrote in message
ups.com...
Hi there,
Am having touble changing the ticklable number format based on the
contents of a cell(ie P for percent, N for number) using the change
event.
Here is what I have. I cant see any wrong with it, but any advice is
warmly welcome.
Private Sub Worksheet_Change(ByVal Target As Range)
graphtype = Range("C49").Value
With ActiveSheet.ChartObjects("Chart 2").Chart
Select Case graphtype
Case "P"
.Axis(xlValue).TickLabels.NumberFormat = "0%;[Red](0%)"
Case "N"
.Axis(xlValue).TickLabels.NumberFormat =
"#,##0;[Red](#,##0)"
End Select
End With
End Sub
regards,
david
|