How do I set the Maximum Property for this Chart in code

A

Ayo

".Axes(xlValue).MaximumScale =" don't work inside the With ChtObj.Chart

Set ChtObj = Worksheets(shtName).ChartObjects.Add(Left:=375, Top:=7,
Width:=575, Height:=360)

With ChtObj.Chart
.ChartType = xlColumnClustered
.Legend.Position = xlLegendPositionBottom
.SetSourceData Source:=ActiveSheet.Range("$K$26:$L$" & rngLength)
.SeriesCollection(1).Name = "Quantity by Date"
.HasTitle = True
.ChartTitle.Text = ChtName

With .SeriesCollection.NewSeries
.Values = Sheets(shtName).Range("$M$26:$M$" & rngLength)
.XValues = Sheets(shtName).Range("$K$26:$K$" & rngLength)
.Name = "Cumulative Quantity"
.ChartType = xlLine
End With
.SeriesCollection(2).AxisGroup = 2
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top