Hi Scott,
Try something like this;
Assuming your data is in Column "A"
sub tester()
Dim Last10 As Range
Range("A1").Select
Set Last10 = Range(ActiveCell.End(xlDown).Offset(-10, 0), ActiveCell.End(xlDown)) '.Select
Charts.Add
ActiveChart.ChartType = xlColumnClustered
ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range(Last10.Address), PlotBy _
:=xlColumns
ActiveChart.Location Where:=xlLocationAsObject, Name:="Sheet1"
With ActiveChart
.HasAxis(xlCategory, xlPrimary) = True
.HasAxis(xlValue, xlPrimary) = True
End With
ActiveChart.Axes(xlCategory, xlPrimary).CategoryType = xlAutomatic
End Sub
Ivan
From what I understood of your problem, you are not sure which your last 10 rows
will be.
To fix this, I recommend writing a macro that will read the value of each cell in that
row and convert it to a string (that is, text). Then check if this string is blank, i.e. = "".
If so, you know that's your last row, then subtract 10.
I don't know what your level of knowledge of macros is. I could go in more details.