0

I have a question about sorting an array in VBA. Previously I programmed in Matlab and I would like to do something like: P = sortrows(P,3), but using VBA. That organizes a matrix by the 3 column.

Is it possible to do something similar in VBA?

Does anyone can help me ?

Thank u!

Augusto Mello

Augusto
  • 21
  • 6
  • Try adapting Crocus Crow's answer here: http://www.vbaexpress.com/forum/showthread.php?41938-Solved-sort-multi-dimensional-array – Tim Williams Jul 31 '14 at 16:30

1 Answers1

0

Use Range.sort

Dim lastrow As Long
lastrow = Cells(Rows.Count, 2).End(xlUp).Row
Range("C" & lastrow).Sort 
lakshmen
  • 28,346
  • 66
  • 178
  • 276