Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,582
Default 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?





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,600
Default 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?







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default PlotArea.Left Question

Thanks, I believe I have it working now.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Left/Right question Singh Excel Discussion (Misc queries) 3 September 22nd 08 10:18 PM
Left Function Question Help! James8309 Excel Worksheet Functions 3 August 22nd 08 01:24 AM
PlotArea question [email protected] Charts and Charting in Excel 1 May 1st 07 07:30 AM
2007 PlotArea.Left RB Smissaert Excel Programming 3 October 8th 06 01:25 AM
Question about using the right or left formula Jambruins Excel Discussion (Misc queries) 4 July 8th 05 10:15 PM


All times are GMT +1. The time now is 08:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"