I have a chart with column stacked and line from a table of 60 columns and the 59th column alone is the line which cuts the columns something like the image shown. Problem is I have code like this
But if a column in the table is added or deleted I have to manually enter the column number for the line.
Can someone tell me how to make the chart dynamically understand to choose only the second last column for line chart.
Code:
ActiveChart.SeriesCollection(59).ChartType = xlLine
ActiveChart.Axes(xlValue).MajorGridlines.Select
But if a column in the table is added or deleted I have to manually enter the column number for the line.
Can someone tell me how to make the chart dynamically understand to choose only the second last column for line chart.