(Solved) – Show date value on horizontal axis VBA excel

(solved)-–-show-date-value-on-horizontal-axis-vba-excel

I am trying to create a chart with VBA, collecting data with the code from a table (not selecting directly the data in the worksheet but doing some internal calculation) in the end my code is this:

Charts.Add
    With ActiveChart
        .ChartArea.ClearContents
        .ChartType = xlXYScatterLines
            .SeriesCollection.NewSeries
            .SeriesCollection(i).XValues = listax
            .SeriesCollection(i).Values = ydata
            .SeriesCollection(i).Name = "dataexample"

But it show 1,2,3.. in the horizontal axis, and I need to show dates (see image)

enter image description here

Can you tell me how to edit and have the dates below? If I put the mouse on the point, it shows me the right value on the horizontal axis..

enter image description here

Leave a Reply

Your email address will not be published. Required fields are marked *