Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Editing Excel Chart

Status
Not open for further replies.

Tracyice

Technical User
Mar 10, 2004
30
US
I have multiple charts in excel and I would like to make them all of the same size. Is there an easy way of doing this without manually changing all of them?
 
Can you give more information? Are all of the charts on the same worksheet or seperate ones? Do they use the same data set/data source or different ones? Are they all the same type of chart ie bar or line , or are they different? I think that will help to troubleshoot...


misscrf

Management is doing things right, leadership is doing the right things
 
All charts are on the same worksheet. They use different data sources. They are all the same time of line graph. Thank you!
 
Hi,

Not without VBA code...
Code:
nHeight=100
nWidth=100

for each co in activesheet.chartobjects
  with co
    .width= nWidth
    .height= nHeight
  end with
next


Skip,

[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue]
 
Tracyice,

I should have coded it more completely...
Code:
Sub ResizeCharts()
  nHeight = InputBox("Height in inches:") * Application.InchesToPoints
  nWidth = InputBox("Width in inches:") * Application.InchesToPoints

  For Each co In ActiveSheet.ChartObjects
    With co
      .Width = nWidth
      .Height = nHeight
    End With
  Next
End Sub


Skip,

[red]Be advised:[/red] [glasses]
Alcohol and Calculus do not mix!
If you drink, don't derive! [tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top