Format chart data labels modified by vba

jedoo_19

New Member
Joined
Feb 19, 2004
Messages
6
Hi,

I have data labels that I modify with vba in a stock chart.
My problem is that I cannot change the number format of the labels, after they are modified by the macro.

Have you any information about this ? Is there a way to change the code to be able to change the number format ?

Any help appreciated.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.

jedoo_19

New Member
Joined
Feb 19, 2004
Messages
6
The code is a simple loop that add values to labels from a range of cells
I already tried to change and to remove the format line with no success
Code:
For Each cLabel In Worksheets("Chart Data").Range("F2:F10")
      LinkCellValue = cLabel.Value
      LinkCellValue = Format(LinkCellValue, "+ ###0;- ###0;0")
                        
      'Add label to bars
      ActiveChart.SeriesCollection(2).Points(i).dataLabel.Characters.Text = LinkCellValue
                                  
        i = i + 1
        
Next cLabel
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,322
Messages
5,769,452
Members
425,548
Latest member
macjagger17

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top