See the Chart Height/ Width values in cells

Frankroger

New Member
Joined
Nov 16, 2023
Messages
21
Office Version
  1. 2013
Platform
  1. Windows
Is there a way to see the chart height and width of the chart area/plot area in cells on the spreadsheet?

So that I can see these values from the cells on the spreadsheet, rather than having to open the formatting option box of the chart?

If the chart height and width changes, then the cell would update to show these values.

This code below lets me change the chart height via a cell value, but I'm wanting to do the reverse of this and just see what the chart height/width values are from cells on the sheet, rather than be able to change it.

Also does the plot area even have such options of height and width?
As their is no options to change the proportions of the plot area within the formatting box, so I presume it's linked in some way to the size of the chart area.

Any help would be greatly appreciated!


Sub AmendChartHeight()
ActiveSheet.ChartObjects("Chart 1").Height = Range("A1")
End Sub
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Ahh I've figured part of it now, the only problem is that the cell doesn't update itself automatically when I resize the chart, but have to manually click on the cell for it to update.

Is there a vba code to force the recalculation of a cell if there has been a change to the height or width of a given chart?


Function Chart Height()

ChartHeight = Activesheet.ChartObjects("Chart 1").Height

End Function

Then entering =ChartHeight() into cell as formula
 
Upvote 0

Forum statistics

Threads
1,223,888
Messages
6,175,219
Members
452,619
Latest member
Shiv1198

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top