ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Setting size (https://www.excelbanter.com/excel-programming/365782-setting-size.html)

Freddie Mac

Setting size
 
I have a problem when using a macro to set size of a chart. I acnnot use the
macro recorder so I want to be able to set size in code. My code is:

Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:="Standard"
........
ActiveChart.Shapes.ChartArea.Height = 1000

As you may see the last line is faulty..I just dont know how to write it.
What I want to do is to set the size (height and width) in the code. If you
know how to solve this please help me.

Mark Driscol[_2_]

Setting size
 
Will this work for you?

ActiveChart.PlotArea.Width = ???
ActiveChart.PlotArea.Height = ???

Replace the ???s with whatever numbers you need.


Mark


Freddie Mac wrote:
I have a problem when using a macro to set size of a chart. I acnnot use the
macro recorder so I want to be able to set size in code. My code is:

Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:="Standard"
.......
ActiveChart.Shapes.ChartArea.Height = 1000

As you may see the last line is faulty..I just dont know how to write it.
What I want to do is to set the size (height and width) in the code. If you
know how to solve this please help me.



Freddie Mac

Setting size
 
great thanks!!!!! Do you know how to set the size for the whole chart area
also? Would be awsome!

"Mark Driscol" skrev:

Will this work for you?

ActiveChart.PlotArea.Width = ???
ActiveChart.PlotArea.Height = ???

Replace the ???s with whatever numbers you need.


Mark


Freddie Mac wrote:
I have a problem when using a macro to set size of a chart. I acnnot use the
macro recorder so I want to be able to set size in code. My code is:

Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:="Standard"
.......
ActiveChart.Shapes.ChartArea.Height = 1000

As you may see the last line is faulty..I just dont know how to write it.
What I want to do is to set the size (height and width) in the code. If you
know how to solve this please help me.




Mark Driscol[_2_]

Setting size
 
First, make sure your Chart's page setup is not set to fill up the
entire page with the Chart.

ActiveChart.PageSetup.ChartSize = xlScreenSize

After that, you can use

ActiveChart.ChartArea.Height = ???
ActiveChart.ChartArea.Width = ???

Mark


Freddie Mac wrote:
great thanks!!!!! Do you know how to set the size for the whole chart area
also? Would be awsome!

"Mark Driscol" skrev:

Will this work for you?

ActiveChart.PlotArea.Width = ???
ActiveChart.PlotArea.Height = ???

Replace the ???s with whatever numbers you need.


Mark


Freddie Mac wrote:
I have a problem when using a macro to set size of a chart. I acnnot use the
macro recorder so I want to be able to set size in code. My code is:

Charts.Add
ActiveChart.ApplyCustomType ChartType:=xlUserDefined, TypeName:="Standard"
.......
ActiveChart.Shapes.ChartArea.Height = 1000

As you may see the last line is faulty..I just dont know how to write it.
What I want to do is to set the size (height and width) in the code. If you
know how to solve this please help me.






All times are GMT +1. The time now is 05:42 PM.

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