ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Charts and Charting in Excel (https://www.excelbanter.com/charts-charting-excel/)
-   -   chart resize macro (https://www.excelbanter.com/charts-charting-excel/240327-chart-resize-macro.html)

Josh Craig

chart resize macro
 
Hi all,

I often have to put a large number of charts in a report that need to be the
same size.

I'd like to create a macro that automatically resizes selected charts rather
than manually resizing each one.

I've tried to record a macro where I select a chart and resize it but the
resizing part doesn't seem to get recorded.

Any idea on how I would do this?

Thanks,

Josh

Fan924

chart resize macro
 
Sub ChartResize1024x768()
Dim oCht As Chart
Set oCht = ActiveChart
oCht.Parent.Width = 768 '1024*.75=768
oCht.Parent.Height = 576 '768 *.75=576
End Sub



Josh Craig

chart resize macro
 
Works perfectly. Thanks very much!

"Fan924" wrote:

Sub ChartResize1024x768()
Dim oCht As Chart
Set oCht = ActiveChart
oCht.Parent.Width = 768 '1024*.75=768
oCht.Parent.Height = 576 '768 *.75=576
End Sub





All times are GMT +1. The time now is 03:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com