I am trying to create a line graph on VBA.
I have the following code:
Dim x as Range
Dim cli as Range
Dim dis as Range
Sheets("AF").Select
Range("C2").Select
Set x = Application.Range(Selection, Selection.End(xlToRight))
Range("C3").Select
Set cli = Application.Range(Selection, Selection.End(xlToRight))
Range("C4").Select
Set dis = Application.Range(Selection, Selection.End(xlToRight))
Sheets("PAPM").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.FullseriesCollection(1).Select
ActiveChart.FullseriesCollection(1).Values = cli
ActiveChart.FullseriesCollection(2).Values = dis
However the issue is that it is only plotting the line "cli" since it has data from C2 to Z2, and it is not plotting "dis" since that data starts from E2 to Z2. In the code if I start "dis" from E2 then the graphs are not on comparable months which is the x axis.
Please help me to select the range that from C2 which has no values as well.