ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   How do I write text on a bar chart using VBA (https://www.excelbanter.com/charts-charting-excel/248203-how-do-i-write-text-bar-chart-using-vba.html)

Barney

How do I write text on a bar chart using VBA
 
I have a worksheet with various bar charts. I want to write text inside the
bar but cannot figure out the correct control name to modify the text. Any
help is appreciated

Jon Peltier[_2_]

How do I write text on a bar chart using VBA
 
You can add a data label to the data point.

With ActiveChart.SeriesCollection(1).Points(1)
.HasDataLabel = True
With .Datalabel
.Caption = "Hello"
.Position = xlLabelPositionCenter
.Orientation = xlUpward
'' and more if desired
End With
End With

- Jon
-------
Jon Peltier
Peltier Technical Services, Inc.
http://peltiertech.com/



Barney wrote:
I have a worksheet with various bar charts. I want to write text inside the
bar but cannot figure out the correct control name to modify the text. Any
help is appreciated



All times are GMT +1. The time now is 01:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com