PDA

View Full Version : [SOLVED] Changing the properties of an embedded chart without select or activate



vanhunk
12-03-2013, 01:15 AM
Is it possible to change the properties, such as the Y-scale, of a named embedded chart, on an inactive sheet without selecting or activating the named chart? For example: The name of the embedded chart is "Kaart 1"; The sheet it is on is called "Findings"; The macro is run from another sheet and will change the Y-scale properties according to values in cells. Thank you!1 Regards, vanhunk

Aflatoon
12-03-2013, 03:25 AM
Yes it is:
With Sheets("Findings").ChartObjects("Kaart 1").Chart.Axes(xlValue)
.MinimumScale = Sheets("Sheet1").Range("B4").Value
.MaximumScale = Sheets("Sheet1").Range("B3").Value
End With

for example.

Bob Phillips
12-03-2013, 03:25 AM
With Worksheets("Findings").ChartObjects("Kaart 1").Chart

.Axes(xlValue).MinimumScale = Activesheet.Range("A1").Value
.Axes(xlValue).MaximumScale = Activesheet.Range("A2").Value
End With

vanhunk
12-03-2013, 04:45 AM
@Aflatoon & @xld: Thank you guys, its perfect. For some reason I just couldn't get it right. Regards, vanhunk