Sub btn1()
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.SeriesCollection(1).Select
'select a line color for the graph
With Selection.Border
.ColorIndex = 8
.Weight = xlThin
.LineStyle = xlContinuous
End With
ActiveChart.ChartArea.Select
ActiveChart.PlotArea.Select
'specify the column with the data to be plotted: sheet1, row2, column2 to row 31 column 2 (ie, B2:B32)
ActiveChart.SeriesCollection(1).Values = "=Sheet1!R2C2:R31C2"
'assuming that the columns have titles, use the column header as the graph title
ActiveChart.SeriesCollection(1).Name = "=Sheet1!R1C2" ' <--- Row 1 Col 2 = B1
End Sub
Bookmarks