Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have a program part of which generates simple 2D XY line charts.
It does all the chart formatting €“ scales, color, labels etc, but I don't know how to size it. I believe that as it is embedded, I need to set up a class module to use "events". I've done this and it works ok, running automatically when I "run a chart." But what code can I put in the class module, to make the chart fill the area I require - ideally a range eg A200:G400? Any help would be greatly appreciated. Don W B -- donwb |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The following code will size a chartobject containing an embedded chart to
fit the nominated cell range: Set r = Range("A200:G400") Set co = ChartObjects(1) With co .Top = r.Top .Left = r.Left .Width = r.Width .Height = r.Height End With John Green - Excel MVP "donbowyer" wrote in message ... I have a program part of which generates simple 2D XY line charts. It does all the chart formatting - scales, color, labels etc, but I don't know how to size it. I believe that as it is embedded, I need to set up a class module to use "events". I've done this and it works ok, running automatically when I "run a chart." But what code can I put in the class module, to make the chart fill the area I require - ideally a range eg A200:G400? Any help would be greatly appreciated. Don W B -- donwb |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks John
So simple but so effective. It worked perfectly and without a class module. -- donwb "John Green" wrote: The following code will size a chartobject containing an embedded chart to fit the nominated cell range: Set r = Range("A200:G400") Set co = ChartObjects(1) With co .Top = r.Top .Left = r.Left .Width = r.Width .Height = r.Height End With John Green - Excel MVP "donbowyer" wrote in message ... I have a program part of which generates simple 2D XY line charts. It does all the chart formatting - scales, color, labels etc, but I don't know how to size it. I believe that as it is embedded, I need to set up a class module to use "events". I've done this and it works ok, running automatically when I "run a chart." But what code can I put in the class module, to make the chart fill the area I require - ideally a range eg A200:G400? Any help would be greatly appreciated. Don W B -- donwb |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Chart sizing | Excel Discussion (Misc queries) | |||
Chart Sizing | Charts and Charting in Excel | |||
chart sizing | Charts and Charting in Excel | |||
sizing a chart | Charts and Charting in Excel | |||
Inconsistent Chart Sizing Into PPT | Charts and Charting in Excel |