ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   PlotArea.Left Question (https://www.excelbanter.com/excel-programming/417208-plotarea-left-question.html)

Richard Weatherly[_2_]

PlotArea.Left Question
 
I want to place a text box at a specific location in the plot area of a chart
using VBA. ActiveChart.PlotArea.Left and ActiveChart.PlotArea.Width will
return the left edge and width of the plot area, but the .Left function
includes the "Y" axis scale as the left most point. In other words, the
..Left point is the left edge of the scale values and not the left edge of the
plot area.

Any suggestions?

Peter T

PlotArea.Left Question
 
Select a chart, ensure it has a left value axis

Sub test2()
Dim lt as single, tp as single

With ActiveChart.Axes(xlValue, xlPrimary)
lt = .Left
tp = .Top
End With

ActiveChart.Shapes.AddShape 1, lt, tp, 30, 20

End Sub

should add a rectangle to the top-left corner of the apparent shaded plot
area,

Regards,
Peter T




"Richard Weatherly" wrote in
message ...
I want to place a text box at a specific location in the plot area of a
chart
using VBA. ActiveChart.PlotArea.Left and ActiveChart.PlotArea.Width will
return the left edge and width of the plot area, but the .Left function
includes the "Y" axis scale as the left most point. In other words, the
.Left point is the left edge of the scale values and not the left edge of
the
plot area.

Any suggestions?




Jon Peltier

PlotArea.Left Question
 
Without having to assume anything about axes, use:

With ActiveChart.PlotArea
lt = .InsideLeft
tp = .InsideTop
wd = .InsideWidth
ht = .InsideHeight
End With


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


"Peter T" <peter_t@discussions wrote in message
...
Select a chart, ensure it has a left value axis

Sub test2()
Dim lt as single, tp as single

With ActiveChart.Axes(xlValue, xlPrimary)
lt = .Left
tp = .Top
End With

ActiveChart.Shapes.AddShape 1, lt, tp, 30, 20

End Sub

should add a rectangle to the top-left corner of the apparent shaded plot
area,

Regards,
Peter T




"Richard Weatherly" wrote in
message ...
I want to place a text box at a specific location in the plot area of a
chart
using VBA. ActiveChart.PlotArea.Left and ActiveChart.PlotArea.Width will
return the left edge and width of the plot area, but the .Left function
includes the "Y" axis scale as the left most point. In other words, the
.Left point is the left edge of the scale values and not the left edge of
the
plot area.

Any suggestions?






Peter T

PlotArea.Left Question
 
Yes that's a much better approach.

Regards,
Peter T

"Jon Peltier" wrote in message
...
Without having to assume anything about axes, use:

With ActiveChart.PlotArea
lt = .InsideLeft
tp = .InsideTop
wd = .InsideWidth
ht = .InsideHeight
End With


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


"Peter T" <peter_t@discussions wrote in message
...
Select a chart, ensure it has a left value axis

Sub test2()
Dim lt as single, tp as single

With ActiveChart.Axes(xlValue, xlPrimary)
lt = .Left
tp = .Top
End With

ActiveChart.Shapes.AddShape 1, lt, tp, 30, 20

End Sub

should add a rectangle to the top-left corner of the apparent shaded plot
area,

Regards,
Peter T




"Richard Weatherly" wrote in
message ...
I want to place a text box at a specific location in the plot area of a
chart
using VBA. ActiveChart.PlotArea.Left and ActiveChart.PlotArea.Width
will
return the left edge and width of the plot area, but the .Left function
includes the "Y" axis scale as the left most point. In other words, the
.Left point is the left edge of the scale values and not the left edge
of the
plot area.

Any suggestions?








Richard Weatherly[_2_]

PlotArea.Left Question
 
Thanks, I believe I have it working now.



All times are GMT +1. The time now is 02:25 PM.

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