BrianExcel
Well-known Member
- Joined
- Apr 21, 2010
- Messages
- 975
The following code is working perfectly to set axis and create a chart with the exception of ONE line apparently...
The line not working is seventh from the bottom..
Actually, as written it works fine - it's selecting the proper values. But I need it to dynamically choose the cells based on how many are in the column. The data is in a table, so I've been trying to reference the header to select the column. The second axis works fine and selects all the right data, but for some reason that one line starts in row2 instead of row 1 (header) and ends one short of the end of the table dataset.
Any thoughts how I can more dynamically set that range? The number of values in that range will change, so having a preset line of code to reference it won't work long-term.
VBA Code:
With ActiveChart
.ChartTitle.Select
.ChartTitle.Text = "Ball Edit Percentage"
Selection.Format.TextFrame2.TextRange.Characters.Text = "Ball Edit Percentage" & vbCrLf & res
.Axes(xlCategory).AxisTitle.Select
.Axes(xlCategory, xlPrimary).AxisTitle.Text = "Venue"
Selection.Format.TextFrame2.TextRange.Characters.Text = "Venue" & vbCrLf & sChartTitle2
.FullSeriesCollection(1).XValues = "='7DayEdits'!$A$2:$A$55"
.Axes(xlCategory).Select
Selection.TickLabels.Orientation = xlUpward
End With
Next i2
End If
Next sh
The line not working is seventh from the bottom..
Code:
.FullSeriesCollection(1).XValues = "='7DayEdits'!$A$2:$A$55"
Actually, as written it works fine - it's selecting the proper values. But I need it to dynamically choose the cells based on how many are in the column. The data is in a table, so I've been trying to reference the header to select the column. The second axis works fine and selects all the right data, but for some reason that one line starts in row2 instead of row 1 (header) and ends one short of the end of the table dataset.
Any thoughts how I can more dynamically set that range? The number of values in that range will change, so having a preset line of code to reference it won't work long-term.