ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   chart text position (https://www.excelbanter.com/excel-programming/381731-re-chart-text-position.html)

Jon Peltier

chart text position
 
Those pesky recorded macros only do what you did, not what you wanted to do.
Try

Selection.ShapeRange.Left = 36
Selection.ShapeRange.Top = 24

or

ActiveChart.Shapes("TextBox 1").Left = 36
etc.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Tutorials and Custom Solutions
http://PeltierTech.com
_______


"Chris" wrote in message
...
Is there a way to set a text box to an absolute position on a chart? I'm
using a macro to create charts for me and I assigned text boxes to certain
locations on the chart. The only thing is, the text boxes don't stay on
the
same spot if I use the following code because each text box is of
different
length.

Selection.ShapeRange.IncrementLeft -275.52
Selection.ShapeRange.IncrementTop -188.95

If I run the macro on one worksheet, the text lines up perfectly. It
doesn't line up perfectly on a different worksheet since the text inside
the
text box refers to a cell that is of different character length for each
sheet.





All times are GMT +1. The time now is 12:33 AM.

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