Hide datalabel values below 3 and above minus 3

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,
I'am trying to write a macro that hides values below 3 and above -3 BUT without showing the decimals. The code here under works perfectly if numbers have no decimal, and I've tried so many things that I've lost my inspiration...
Could anyone help me on this please
Thanks a lot !!!

..../
With ActiveChar
countSeries = .SeriesCollection.Coun
For iserie = 1 To countSeries
.SeriesCollection(iserie).DataLabels.NumberFormat = "[>=" & value & "];[<-" & value & "]
Next iseri
//...
 
Try this in your code:

"[>=" & value & "]0;[<-" & value & "]0;"""""

which produces:

[>=3]0;[<=-3]0;""

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Waw
Thank you, it is already much better, the only thing now is that the "-" signs of the Datalebel stay on the chart without their number (sign should dissapear too)... Do you know where I can find documentation about how to use those "codes" to format numbers, are they rules somewhere about that
Thanks a lot for your help!
 
Okay, this time I actually tested it first, what a concept. The number
format you want is:

[>=3]0;[<=-3]0;

or in VBA:

"[>=" & value & "]0;[<-" & value & "]0;"

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______
 
Thanks a lot, it works perfectly... all of this because a ";" was missing
Thanks again for your help
 
Back
Top