Ho do I resize multiple charts?

C

chairboy

I have a spreadsheet that contains multiple instances of 2 different charts,
based on templates. Yesterday I opened the spreadsheet and all the charts
were resized so they information no longer fit into the window around the
chart. This happened to all the charts. There must be a way to get them all
resized to the way they were, globally.
 
S

Shane Devenshire

Hi,

You can do it for all charts on a sheet:

1. Press F5, Special, Objects
2. Right-click any of the charts and choose Format Object
3. Enter a Height and Width on the Size tab and press OK.
 
C

chairboy

Hi Shane,

Thanks for your response, but I'm stymied at step one. F5 has no effect.
What is the menu equivalent of F5?

Thanks,
Bob Venezia
 
C

chairboy

I'm still stymied, but after some more exploring, and noting which options
are grayed out for me, I'm going to give some more details about my
sreadsheet.

I have a spreadsheet that tracks work orders in a production studio. There's
a worksheet that tracks a week of work by the hour. I made a chart from that
data, and moved it to its own worksheet.

My spreadsheet has each week of the year, and each week has two charts on
separate worksheets that represent different data. So my spreasheet has over
100 charts on separate worksheets.

One day last week I opened up my spreadsheet, and every chart was resized so
it no longer fit inside its window. This happened globally to 2 different
types of charts, and it's a lot of work to resize each one individually. I
don't know how it happened, but I'm willing to believe it was user error
(though I have no idea what I could have done to cause it). But if I did
cause it, there must be some way to get back in and fix it. I am looking for
that way.

Thanks,
Bob Venezia
 
J

Jon Peltier

Are these separate charts on separate worksheets? Or on separate chart
sheets? A worksheet is the kind of sheet with rows and columns. Shane's
approach would help select all the charts embedded on a worksheet and format
them en masse.

What version of Excel are you using?

- Jon
 
C

chairboy

I guess they'd be chartsheets. I created them from data on a worksheet, then
moved them to their own sheets. I'm using Excel 2007.

Thanks,
Bob
 
J

Jon Peltier

I've heard more complaints about charts resizing themselves in Excel 2007
than in all previous versions combined. I don't know why it happens or why
I've been relatively immune.

If the resizing only affects the plot areas, then you could fix up one
chart, and while it is active, run this VB procedure.

Sub FixCharts()
Dim cht As Chart

If Not ActiveChart Is Nothing Then
For Each cht In ActiveWorkbook.Charts
If cht.Name <> ActiveChart.Name Then
cht.PlotArea.Width = ActiveChart.PlotArea.Width / 2
cht.PlotArea.Height = ActiveChart.PlotArea.Height / 2
cht.PlotArea.Left = ActiveChart.PlotArea.Left
cht.PlotArea.Top = ActiveChart.PlotArea.Top
cht.PlotArea.Width = ActiveChart.PlotArea.Width
cht.PlotArea.Height = ActiveChart.PlotArea.Height
End If
Next
End If
End Sub

For instructions on running a VB procedure, check out this blog post:
http://peltiertech.com/WordPress/how-to-use-someone-elses-macro/

- Jon
 
C

chairboy

Thanks very much for your effort, Jon. I really appreciate it. I tried
running the macro as instructed, but I couldn't get it to work. I've never
done much with VB, and it's probably unfamiliarity multiplied by user error.
I will explore your blog to learn more about macros and VB. In the meantime,
I'll clean up my spreadsheet one chart at a time, and pray it doesn't
reformat itself again.

best regards,
Bob Venezia
 
J

Jon Peltier

"couldn't get it to work" is a big topic. If you indicate what the error
was, or what happened or didn't happen, it would be easier to figure out
what went wrong.

- Jon
 
C

chairboy

Thanks John,

I went back and reread your earlier mail, and investigated the glossary, and
my problem isn't just in the plot area, it's in the entire chart area. I
originally made my chart and it bcame part of the worksheet it represented. I
then moved the chart to its own worksheet. The new worksheet had a blue field
for the background, and a window, and the whole chart area fit perfectly in
the window. When I clicked on a corner of the chart, and got Chart Tools, and
selected the Format Tab, the size was 6.87" h x 9.48" w. That was back in the
good old days.

One day I opened my spreadsheet and the chart size was 9.21" h x 12.68" w.
The window on the worksheet is still the same size, so a lot of the chart is
no longer visible, and you can't see the legend either.

It would be one thing if I just needed to resize this one chart, but my
spreadsheet has 52 of these charts, and 52 of another chart, and all were
resized.

But we're talking chart area, not plot area, so when I say the instructions
didn't work, I didn't realize the difference, and I hadn't selected just the
plot area.

I could send you screenshots if that would help.

Thanks,
Bob Venezia
 
J

Jon Peltier

Is there an empty white area around the chart area of each chart, or is it
only gray? That is, does the chart area resize on its own, or is the actual
usable page size (page size minus margins) changing?

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services, Inc.
http://PeltierTech.com/WordPress/
_______


chairboy said:
Thanks John,

I went back and reread your earlier mail, and investigated the glossary,
and
my problem isn't just in the plot area, it's in the entire chart area. I
originally made my chart and it bcame part of the worksheet it
represented. I
then moved the chart to its own worksheet. The new worksheet had a blue
field
for the background, and a window, and the whole chart area fit perfectly
in
the window. When I clicked on a corner of the chart, and got Chart Tools,
and
selected the Format Tab, the size was 6.87" h x 9.48" w. That was back in
the
good old days.

One day I opened my spreadsheet and the chart size was 9.21" h x 12.68" w.
The window on the worksheet is still the same size, so a lot of the chart
is
no longer visible, and you can't see the legend either.

It would be one thing if I just needed to resize this one chart, but my
spreadsheet has 52 of these charts, and 52 of another chart, and all were
resized.

But we're talking chart area, not plot area, so when I say the
instructions
didn't work, I didn't realize the difference, and I hadn't selected just
the
plot area.

I could send you screenshots if that would help.

Thanks,
Bob Venezia
 
C

chairboy

I've sent you an email with screenshots showing what my charts look like,
before they're fixed, and after.

Bob

Jon Peltier said:
Is there an empty white area around the chart area of each chart, or is it
only gray? That is, does the chart area resize on its own, or is the actual
usable page size (page size minus margins) changing?

- Jon
 
J

Jon Peltier

Unbelievable. The chart area is allowed to expand to a larger size than the
available page size.

Okay, let's retool the earlier procedure.

Sub FixCharts()
Dim cht As Chart

If Not ActiveChart Is Nothing Then
For Each cht In ActiveWorkbook.Charts
If cht.Name <> ActiveChart.Name Then
''cht.ChartArea.Left = ActiveChart.ChartArea.Left
''cht.ChartArea.Top = ActiveChart.ChartArea.Top
cht.ChartArea.Left = 0
cht.ChartArea.Top = 0
cht.ChartArea.Width = ActiveChart.ChartArea.Width
cht.ChartArea.Height = ActiveChart.ChartArea.Height

cht.PlotArea.Width = ActiveChart.PlotArea.Width / 2
cht.PlotArea.Height = ActiveChart.PlotArea.Height / 2
cht.PlotArea.Left = ActiveChart.PlotArea.Left
cht.PlotArea.Top = ActiveChart.PlotArea.Top
cht.PlotArea.Width = ActiveChart.PlotArea.Width
cht.PlotArea.Height = ActiveChart.PlotArea.Height
End If
Next
End If
End Sub

The two lines I've commented out should work, but don't. If they are used
the other charts are offset right and down a few points.

- Jon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top