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

What do {} around a formula in the formula bar mean?
{Formula} means the formula was entered using Ctrl+Shift+Enter signifying an old-style array formula.

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
 
Upvote 0

Forum statistics

Threads
1,187,188
Messages
5,962,103
Members
438,585
Latest member
peterLEE0223

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