Forum Discussion
Odintsov_Maksim
May 23, 2020Copper Contributor
Large amount of data sorting
Please, help.
Need to sort numeric data contained in large numbers (several thousand) strings.
The data in each string must be sorted separately.
How can this be done quickly.
Apologies. You're correct. Small adjustment needed: change
If MyCol <> 1 Thento
If MyCol > 2 ThenRegards
16 Replies
- wumoladIron Contributor
it might be difficult to visualize what you are trying to achieve without showing a sample data. Are you able to show a sample data after removing sensitive information?
Cheers
- Odintsov_MaksimCopper Contributor
- Jos_WoolleyIron Contributor
Sub SortAllRows() Dim LRow As Long Dim i As Long Dim MyRow As Range Dim MyKey As Range With ThisWorkbook.Worksheets("Sheet1") LRow = .Cells(.Rows.Count, 1).End(xlUp).Row For i = 1 To LRow Set MyRow = .Range("B1:I1").Offset(i - 1, 0) Set MyKey = Application.Index(MyRow, 1) MyRow.Sort Key1:=MyKey, Order1:=xlAscending, Orientation:=xlLeftToRight Next i End With End SubRegards