This codeproduces this chart Chart.3g.1.jpgSub CreateChart()'PURPOSE: Create a chart (chart dimensions are required) Dim rng As Range Dim cht As ChartObject Dim i As Long i = Cells(2, "P").Value 'Debug.Print "P2 =", i 'Your data range for the chart Set rng = ActiveSheet.Range("P4:U" & i) 'Create a chart Set cht = ActiveSheet.ChartObjects.Add( _ Left:=30, _ Width:=580, _ Top:=250, _ Height:=320) 'Give chart some data cht.Chart.SetSourceData Source:=rng 'Determine the chart type cht.Chart.ChartType = xlXYScatterLines cht.Chart.HasTitle = True cht.Chart.ChartTitle.Text = Cells(2, 4).Value & "-Site Model of Population" End Sub
I would like it colored to look like Chart.3g.jpg Note, the two charts use different data.


Reply With Quote
