Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Charting / October 2006

Tip: Looking for answers? Try searching our database.

Sizing individual charts with a macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ellinoz - 13 Oct 2006 12:00 GMT
Hi,

I'm kind of flying along through VB on a wing and a prayer, so would really
appreciate some help with sizing individual charts in Excel.  I have found
some coding for resizing all the charts on a sheet, but really need to be
able to click on a chart and resize them individually.  

I can manage it as long as I have selected the chart with the Select cursor
(from the Drawing menu) and it is seen as a shape, but if I am in the chart
in editing mode, I get a run-time error 438, and the message 'Object doesn't
support this property or method'.

I'm in Excel 2003.

Many thanks,
Eleanor
Andy Pope - 13 Oct 2006 12:09 GMT
Hi,

If the chart is active then use the Parent reference to apply sizes

This will make the chart 10% wider.

ActiveChart.Parent.Width = ActiveChart.Parent.Width * 1.1

Cheers
Andy

> Hi,
>
[quoted text clipped - 12 lines]
> Many thanks,
> Eleanor

Signature

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

Ellinoz - 13 Oct 2006 12:58 GMT
Thanks, that's really helpful.  How would I assign a fixed height and width
to this?  I tried using points, and the chart nigh on disappeared to about
0.5x0.5cm!

> Hi,
>
[quoted text clipped - 23 lines]
> > Many thanks,
> > Eleanor
Andy Pope - 13 Oct 2006 14:06 GMT
Not sure what value you used.

This will nake the chart as wide as the columns D:J

ActiveChart.Parent.Width=range("D:J").Width

Cheers
Andy

> Thanks, that's really helpful.  How would I assign a fixed height and width
> to this?  I tried using points, and the chart nigh on disappeared to about
[quoted text clipped - 27 lines]
>>>Many thanks,
>>>Eleanor

Signature

Andy Pope, Microsoft MVP - Excel
http://www.andypope.info

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.