Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Sizing a chart

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Sizing a chart

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Sizing a chart

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
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
Chart sizing WA Excel Discussion (Misc queries) 0 May 4th 10 04:27 PM
Chart Sizing WA Charts and Charting in Excel 0 May 3rd 10 08:48 PM
chart sizing afdmello Charts and Charting in Excel 1 June 20th 09 10:40 PM
sizing a chart Jordan Charts and Charting in Excel 1 February 13th 07 07:30 PM
Inconsistent Chart Sizing Into PPT Phil Hageman Charts and Charting in Excel 1 October 10th 05 11:55 PM


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

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

About Us

"It's about Microsoft Excel"