Format an array

In my chart, I want to format the x axis as a month, but the information in the associated cell is YYYY-MM-dd.

How do I format the array axis:

Here is the line of code:

ChartWindow.Chart3.AddLabels Array Format(newMortgageAmortizationProgramWindow.ListBox1.CellTextAt(remainingMortgageXAxisVariable,0),"MM")

It tells me I have a syntax error but can’t see what I have wrong…


Format expects a number or a date.
CellTextAt(remainingMortgageXAxisVariable,0) is ‘just’ a string


the information in the associated cell is YYYY-MM-dd.

then probably all you need is to clip out the MM
You could use MID but I dont know if API2 will choose 1 or 0 based indices.

So try

var s , mon as string
s = newMortgageAmortizationProgramWindow.ListBox1.CellTextAt(remainingMortgageXAxisVariable,0)
mon = s.mid(5,2)   //might be 6,2

.mid is API1 and uses 1 as a base.
.middle is API2 and uses 0 as a base.

Thanks Jeff. I will give this a try.
And now that I see this, I have an idea… or two…

Once again, thanks.