ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   To sort data in VBA/excel by the method of the minimas (https://www.excelbanter.com/excel-programming/285062-sort-data-vba-excel-method-minimas.html)

Jean-mi

To sort data in VBA/excel by the method of the minimas
 
Hello,
Could somebody find a solution to my problem ?
J Would like to sort datas(numbers) by the method of the
minima. J have displayed 4 numbers of a table named
Valnum.
After this, I have added the following code :
i = 1
For i = 1 To 4
minimum = Application.WorksheetFunction.Min(Valnum)
Worksheets(1).Cells(2,i).Value = Valnum(i)
Worksheets(1).Cells(1,i).Clear
Worksheets(1).Cells(1,i).Value = Worksheets _
(1).Cells(1,i+1).Value
Worksheets(1).Cells(1,i+1).Clear
Worksheets(1).Cells(1,i+1).Value = Valnum(i)
Worksheets(1).Cells(2,i).Clear
i = i + 1
Next i
I would like to use Min in a table of 4 elements, of 3
elements,of 2 , of 1, but I don't know precisely how
to do.
Thank you in advance for all of you who could help me in
the resolution of my problem.

Jean-michel
..



Bill Manville

To sort data in VBA/excel by the method of the minimas
 
Jean-mi wrote:
Could somebody find a solution to my problem ?
J Would like to sort datas(numbers) by the method of the
minima.

Not sure I follow your question, but if the numbers are in the
spreadsheet why not use Excel to sort them. Record a macro while doing
Data / Sort on the cells concerned and you should be most of the way
there.


Bill Manville
MVP - Microsoft Excel, Oxford, England
No email replies please - reply in newsgroup



All times are GMT +1. The time now is 03:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com