I'm trying to create a chart using VBA using the following code:
lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
lc = ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column
Set chtRng = Range(Cells(1, 1), Cells(lr, lc))
ActiveSheet.Shapes.AddChart2(227, xlLine).Select
ActiveChart.SetSourceData Source:=chtRng
ActiveChart.SetElement (msoElementLegendBottom)
Set targetSht = ThisWorkbook.Worksheets("Test_graph")
The data is fetched from the database and the data gets flushed in A to D columns.Data While generating the graph using the above code, I get the following result:Current Results But, out of the fetched data, i want to skip the data in the column C and expect a result something likeExpected Results
Any sort of suggestion or solution is appreciated.
Regards.
PS: I'm new to this platform so kindly excuse me for the formatting.
