excel vba - How can get colors in Axis Labels -


i had problems pivot chart. apply data labels chart, select data labels , open “format data labels” windows, go numbers tab. select “custom” , code : [black] +0%; [red] -0% format positive values black color , format negative values red color. so, how code in macro excel?

i appreciate can provide.

try this:

sub format_datalabel()  dim my_series series dim pt point  'change chart name , update seriescollection number if have more 1 series in chart set my_series = activesheet.chartobjects("chart 1").chart.seriescollection(1)  each pt in my_series.points     pt.datalabel.numberformat = "[black] +0%; [red] -0%" next pt  end sub 

just change chart name , run code.
if have more 1 serries in chart, should identify well.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -