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 / April 2005

Tip: Looking for answers? Try searching our database.

URGENT help!!! chart size! Thank you!

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
crossingmind - 27 Apr 2005 19:06 GMT
I have made lots of charts for the graphic designer. Now she said to me
my charts are too big when she copies those to illustrator (she has to
resize every one). So she asked me to resize all the charts to the size
she wants in excel. Now, my problem is how I can automatically change
the size of my charts. There are too many and I cannot work on
individual. The deadline is approaching soon. Please help me figure it
out! Thank you very much!
Andy Pope - 27 Apr 2005 20:15 GMT
Hi,

If your charts are chart objects on worksheets then you could use the
following code to size (width/height only) all charts to be the same as
the active one.

Sub ResizeAllCharts()
    Dim sngWidth As Single
    Dim sngHeight As Single
    Dim objCht As ChartObject

    sngWidth = ActiveChart.Parent.Width
    sngHeight = ActiveChart.Parent.Height

    For Each objCht In ActiveSheet.ChartObjects
        objCht.Width = sngWidth
        objCht.Height = sngHeight
    Next
End Sub

This will not attempt to make plot areas or any other chart element the
same.

Another way is the click the selection arrow on the drawing toolbar and
then group select all the chartobjects. You can then format the objects
all at only. Again only in terms of width/height of actual chart.

Cheers
Andy

> I have made lots of charts for the graphic designer. Now she said to me
> my charts are too big when she copies those to illustrator (she has to
[quoted text clipped - 3 lines]
> individual. The deadline is approaching soon. Please help me figure it
> out! Thank you very much!

Signature

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

crossingmind - 27 Apr 2005 21:06 GMT
Thank you so much Andy. The latter way worked well. The first way I met
a bug on the line
sngWidth = ActiveChart.Parent.Width
Don't know how to debug it. Could you help more? Thanks a lot!
Andy Pope - 27 Apr 2005 21:26 GMT
Did you have one of the charts selected?
The code will apply the width/height of the currently selected to chart
to all the others on the sheet.

> Thank you so much Andy. The latter way worked well. The first way I met
> a bug on the line
> sngWidth = ActiveChart.Parent.Width
> Don't know how to debug it. Could you help more? Thanks a lot!

Signature

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

crossingmind - 28 Apr 2005 16:55 GMT
Yes, I did select one chart for try, and then the bug window popped
out. Dunno why. Thanks a lot!
Andy Pope - 28 Apr 2005 17:24 GMT
Me neither, I just tried my posted code in another multi chart worksheet
without incident. ???

> Yes, I did select one chart for try, and then the bug window popped
> out. Dunno why. Thanks a lot!

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



©2008 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.