PC Review


Reply
Thread Tools Rate Thread

Chart resize macro

 
 
Eric_B
Guest
Posts: n/a
 
      10th May 2006

I have a sheet that contains about 32 charts, since there are so man
charts I reduced the scale of the sheet so I can see all charts
Problem is the charts are so small I can't interpret them. I want t
create a macro that re-sizes them when I click on them without havin
to write a separate macro for each chart. Is there a way to return th
name of a chart to a variable? Here is what i have so far:

Dim ChtOb As ChartObject


With ActiveSheet

Set ChtOb = .ChartObjects("chart 1")


If ChtOb.Height < 1500 Then
With ChtOb
.Height = 1500
.Width = 2800
.Top = 34
.Left = 43
End With
Else
With ChtOb
.Height = 420
.Width = 715
.Top = 5
.Left = 5
End With
End I

--
Eric_
-----------------------------------------------------------------------
Eric_B's Profile: http://www.excelforum.com/member.php...fo&userid=2448
View this thread: http://www.excelforum.com/showthread.php?threadid=54064

 
Reply With Quote
 
 
 
 
Jon Peltier
Guest
Posts: n/a
 
      10th May 2006
Right click on each chart, select Assign Macro, then select the name of this
macro.

Then put this in the macro:

Set ChtOb = .ChartObjects(Application.Caller)

When you run this macro, you might first determine app.caller's size, then
have the macro loop each chart in the sheet, and if it is larger than X
apply the smaller dimensions, then find the app.caller and if its original
size was small, increase its size.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

"Eric_B" <(E-Mail Removed)> wrote in
message news:(E-Mail Removed)...
>
> I have a sheet that contains about 32 charts, since there are so many
> charts I reduced the scale of the sheet so I can see all charts.
> Problem is the charts are so small I can't interpret them. I want to
> create a macro that re-sizes them when I click on them without having
> to write a separate macro for each chart. Is there a way to return the
> name of a chart to a variable? Here is what i have so far:
>
> Dim ChtOb As ChartObject
>
>
> With ActiveSheet
>
> Set ChtOb = .ChartObjects("chart 1")
>
>
> If ChtOb.Height < 1500 Then
> With ChtOb
> Height = 1500
> Width = 2800
> Top = 34
> Left = 43
> End With
> Else
> With ChtOb
> Height = 420
> Width = 715
> Top = 5
> Left = 5
> End With
> End If
>
>
> --
> Eric_B
> ------------------------------------------------------------------------
> Eric_B's Profile:
> http://www.excelforum.com/member.php...o&userid=24486
> View this thread: http://www.excelforum.com/showthread...hreadid=540641
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to resize chart itself (not chart area) CW Microsoft Excel Charting 4 15th May 2010 03:10 AM
chart resize macro Josh Craig Microsoft Excel Charting 2 25th Aug 2009 03:15 AM
resize chart =?Utf-8?B?YXllc2hh?= Microsoft Excel Charting 1 16th Oct 2006 09:06 AM
How do I resize chart boxes in an organizational chart to fit text =?Utf-8?B?YnRvbGxpbmdlcg==?= Microsoft Powerpoint 0 28th Apr 2005 06:02 PM
How do I resize a chart in Excel after the chart has been saved... =?Utf-8?B?RGlhbmFR?= Microsoft Excel Charting 2 19th Mar 2005 05:27 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:39 PM.