PDA

View Full Version : Set Chart Height and Width to Match Page Dimensions



sam314159
08-03-2010, 09:13 AM
I am using the following code to set a chart's height and width:


ActiveSheet.ChartObjects (1)
With ActiveChart.Parent
.Height = 524.2
.Width = 623
.Top = topStartLocation
.Left = leftStartLocation
End With


That works great on my machine but it looks bad on other machines. Is there any way to change:

.Height = 524.2

to

.Height = pageHeight?

slamet Harto
08-04-2010, 10:40 AM
untested

.Height = (ThisWorkbook.Sheets("1").UsedRange.Rows.Count + 2) * 7