ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   VBA to change size of data labels? (https://www.excelbanter.com/charts-charting-excel/18877-vba-change-size-data-labels.html)

Jason Weiss

VBA to change size of data labels?
 
Hi,

I have a chart with text that is too long for the data labels. Looking
around online, I see that the data labels cannot be resized manually, and a
common recommendation is to replace them with text boxes. I understand
this, but isn't there any way to directly control the width of the data
labels in VBA? I am reasonably proficient at VBA both on its own and within
Excel, and I won't mind if the solution includes some heavy-duty coding.

Thanks to anyone who can help...

....Jay



Andy Pope

Hi,

The data labels have no width or height properties, so VBA code will not
do it either.
The dimensions of the data label are based on text content and font
size. You can changes these but not control the consequences.

The only realistic approach to fully controlled data labels is to use
textboxes.

Cheers
Andy

Jason Weiss wrote:
Hi,

I have a chart with text that is too long for the data labels. Looking
around online, I see that the data labels cannot be resized manually, and a
common recommendation is to replace them with text boxes. I understand
this, but isn't there any way to directly control the width of the data
labels in VBA? I am reasonably proficient at VBA both on its own and within
Excel, and I won't mind if the solution includes some heavy-duty coding.

Thanks to anyone who can help...

...Jay



--

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

Jason Weiss

Andy,

Wow, I had no idea... I thought it would just be a heavy-duty romp through
the object model. Well... This changes my approach. Thanks for your quick
and authoritative response!

....Jay




All times are GMT +1. The time now is 07:27 PM.

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