Resizing charts

N

navin

Hi All,

I have some 20 charts in a spreadsheet. I want all the charts to be of
same size (height and width). I am doing this with the following code:

Dim ChtOb As ChartObject
Dim ChartLeft As Double, ChartTop As Double
Sub ChartSize()
'
' ChartSize Macro
' Macro recorded 3/26/2007 by E366091
'
' Keyboard Shortcut: Ctrl+Shift+E
'

For Each ChtOb In ActiveSheet.ChartObjects
ChtOb.Height = 253.5
ChtOb.Width = 386.25
Next ChtOb
End Sub


Above code works perfectly when resizing the charts, but it again
create a duplicate of all the charts. I am not able to understands, as
why it creates a duplicate of the charts. Please help.

thanks,
navin
 
N

NickHK

Navin,
This code does not create duplicates for me.
Must be something else that is doing that.

NickHK
 
P

Peter T

Hi navin,

As Nick said your code does not create duplicate charts. Maybe you deleted
rows or columns containing charts making them zero height or width and
effectively invisible, then re-created similar charts. With this scenario
running your code would give the impression of creating duplicates.

Regards,
Peter T
 

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