Hi, I wonder whether someone may be able to help me please.
Using a link I found here:
http://http://www.mrexcel.com/forum/excel-questions/485714-creating-chart-dynamic-range-size-visual-basic-applications.html I've put together the following code which creates a chart from a dynamic range.
Sub Test()
Dim LastRow As Long
Dim Rng1 As Range
Dim ShName As String
Sheets("All CDIO F'cst").Select
With ActiveSheet
LastRow = .Range("B" & .Rows.Count).End(xlUp).Row
Set Rng1 = .Range("B9:N" & LastRow)
ShName = .Name
End With
Charts.Add
With ActiveChart
.ChartType = xlColumnClustered
.SetSourceData Source:=Rng1
.Location Where:=xlLocationAsObject, Name:=ShName
End With
End Sub
I am however a little unsure about how to progress this. I'd like to add a secondary axis as a line which appears on the chart ranging from "B8:N8 with B8 the Legend for the data series.
I just wondered whether someone may be able to look at this please and offer some guidance on how I may achieve this.
Many thanks and kind regards
Chris
Bookmarks