Hello,
I don't know if it is the correct forum but I need help for charting correctly.
I have 2 arrays X and Y.
I use the following code in order to chart :
.SeriesCollection(1).Values = Y
.SeriesCollection(1).XValues = X
My problem is the Xvalues are not in ascending order, is it possible to sort it quickly and change the Y array the same way ?
For example :
X = [10 , 2 , 1 , 3 , 1]
Y = [100, 200 , 300, 400, 500]
I would like the following results :
Xsort = [1 , 1 , 2 , 3 , 10]
Ysort = [ 300, 500 , 200, 400, 100]
Is there some kind of option in Excel or do I have to sort using VBA ?
It is kind of tricky because the Xvalues can have doubles and do not correspond to the same Y values.
Thank you in advance.
Bookmarks