BuJay
Board Regular
- Joined
- Jun 24, 2020
- Messages
- 75
- Office Version
- 365
- 2019
- 2016
- 2013
- Platform
- Windows
I have the below code that resizes all charts in a sheet. Is there a way to apply this code to only those charts captured in the range Row 4 through Row 213, for example?
The reason I ask is I want charts in rows 4 through 213 to have consistent shape, but there are a set of charts in rows 214 and lower that need to be a different size, so the macro below changes them and I don't want it to do so.
The reason I ask is I want charts in rows 4 through 213 to have consistent shape, but there are a set of charts in rows 214 and lower that need to be a different size, so the macro below changes them and I don't want it to do so.
VBA Code:
Sub resize_all_charts()
Dim counter As Integer
'Loop through all of the charts
For counter = 1 To ActiveSheet.ChartObjects.Count
'Change the Height and Width values based on your requirements
With ActiveSheet.ChartObjects(counter)
.Height = 195
.Width = 432
End With
Next counter
End Sub