Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,489
Default Using VBA to get all my charts to be same size

Hi Alan,

I don;t think you can change all the objects at once.
Try something like this to do each chart individually.

Sub Equalise_Size()
Dim objChart As ChartObject

For Each objChart In ActiveSheet.ChartObjects
With objChart.Chart.PlotArea
.Width = 374
.Height = 150
End With
Next
End Sub


Alan wrote:

Hi,

I have the following code in a module, but I cannot get it to work:


Sub Equalise_Size()

With ActiveSheet.ChartObjects

.Activate
ActiveChart.PlotArea.Select
Selection.Width = 374
Selection.Height = 150

End With

End Sub


Can anyone suggest why it doesn't work? Excel just tells me that I have a
run time error 438, and that the "Object doesn't support this property or
method."

However, that cannot be true, since I can get it to work on a single
specified chart with the following main body of code:


ActiveSheet.ChartObjects("Chart 1026").Activate
ActiveChart.PlotArea.Select
Selection.Width = 374
Selection.Height = 150


Any suggestion are most welcome.

Thanks,

Alan.




--

Cheers
Andy

http://www.andypope.info

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
how can I make different charts the same size? Sharon Charts and Charting in Excel 2 September 3rd 08 06:04 PM
Unstable charts size kaa_63[_2_] Charts and Charting in Excel 0 January 6th 08 07:14 PM
I need to create 3 pie charts that are same size . . . PYC Charts and Charting in Excel 0 May 3rd 07 01:03 AM
How do you keep charts - graphs the same size? datamonkey Charts and Charting in Excel 0 January 24th 06 12:57 PM
initial size of new charts bob m Charts and Charting in Excel 1 January 22nd 05 02:19 AM


All times are GMT +1. The time now is 10:38 AM.

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"