Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how can I make different charts the same size? | Charts and Charting in Excel | |||
Unstable charts size | Charts and Charting in Excel | |||
I need to create 3 pie charts that are same size . . . | Charts and Charting in Excel | |||
How do you keep charts - graphs the same size? | Charts and Charting in Excel | |||
initial size of new charts | Charts and Charting in Excel |