Excel --- Physical dimensions of a chart object

  • Thread starter Thread starter Nimmi Srivastav
  • Start date Start date
N

Nimmi Srivastav

Is there a way to know the physical dimensions of a chart object on a
worksheet? I have data in several worksheets and I would like all my
charts to be of the same size (obviously this means that data with a
smaller range of values will be more spread out than data with a larger
range of values).

Thanks,
Nimmi
 
This is just an example:

Sub Macro2()
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.ChartArea.Select
n = ActiveSheet.Shapes("Chart 1").Width
m = ActiveSheet.Shapes("Chart 1").Height
MsgBox (n & " BY " & m)
End Sub

Note that you have to activate the chart AND select the ChartArea.
 

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

Back
Top