Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Chart Size & Position

Excel 97 macro copies data blocks to a sheet and plots a graph. This
works well but the size and position is somwhat random. I would like
it to appear below the data array and be about the same size. Can that
be done?

Charts.Add
ActiveChart.ChartType = xlSurface
ActiveChart.SetSourceData Source:=Sheets("Test").Range("E" &
MapPasteTo + 27 & ":Q" & MapPasteTo + 39), _
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Test"

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22
Default Chart Size & Position

The following Methods can be used to modify the dimensions and position of a
ChartObject:
Height
Width
Top
Left

--
If a post answers your question, please mark it as the answer.


"Fan924" wrote:

Excel 97 macro copies data blocks to a sheet and plots a graph. This
works well but the size and position is somwhat random. I would like
it to appear below the data array and be about the same size. Can that
be done?

Charts.Add
ActiveChart.ChartType = xlSurface
ActiveChart.SetSourceData Source:=Sheets("Test").Range("E" &
MapPasteTo + 27 & ":Q" & MapPasteTo + 39), _
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Test"


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default Chart Size & Position

Sub ABC()
Dim ch As Chart
Charts.Add
MapPasteTo = 1
'Set r = Sheets("Test").Range("E" & _
MapPasteTo + 27 & ":Q" & MapPasteTo + 39)
ActiveChart.SetSourceData _
Source:=Sheets("Test").Range("E" & _
MapPasteTo + 27 & ":Q" & MapPasteTo + 39), _
PlotBy:=xlColumns
ActiveChart.ChartType = xlSurface
ActiveChart.Location Whe=xlLocationAsObject, Name:="Test"
Set ch = ActiveChart
With Worksheets("Test").Range("E" & MapPasteTo)
ch.Parent.Top = .Top
ch.Parent.Left = .Left
End With

End Sub

worked for me.

--
Regards,
Tom Ogilvy


"Fan924" wrote:

Excel 97 macro copies data blocks to a sheet and plots a graph. This
works well but the size and position is somwhat random. I would like
it to appear below the data array and be about the same size. Can that
be done?

Charts.Add
ActiveChart.ChartType = xlSurface
ActiveChart.SetSourceData Source:=Sheets("Test").Range("E" &
MapPasteTo + 27 & ":Q" & MapPasteTo + 39), _
PlotBy:=xlColumns
ActiveChart.Location Whe=xlLocationAsObject, Name:="Test"


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 238
Default Chart Size & Position

Worked great Tom. Thanks. I added 40 to the line count so it appears
below the data and added width and height. Exactly what I wanted!
With Worksheets("Test").Range("E" & MapPasteTo + 40)
ch.Parent.Top = .Top
ch.Parent.Left = .Left
ch.Parent.Width = 600
ch.Parent.Height = 300

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
Fix size and position of comment viettuyen Excel Discussion (Misc queries) 1 April 29th 09 12:41 PM
Window Position & Size [email protected] Excel Discussion (Misc queries) 4 May 18th 05 05:21 PM
ho to change in the bubble chart the bubble position and size laszlo Charts and Charting in Excel 0 March 25th 05 04:45 PM
Chart size/position Srikanth Ganesan[_2_] Excel Programming 1 September 1st 04 02:22 AM
Position/Size a MessageBow Stuart[_5_] Excel Programming 3 June 28th 04 05:02 AM


All times are GMT +1. The time now is 11:16 PM.

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

About Us

"It's about Microsoft Excel"