ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Sorting a list of numbers (https://www.excelbanter.com/excel-discussion-misc-queries/265304-re-sorting-list-numbers.html)

Don Guillett[_2_]

Sorting a list of numbers
 
Option Explicit
Sub SASLineEmUP()
Dim lr As Long
Dim i As Long
Dim lc As Long
Application.ScreenUpdating = False
Columns(1).Clear
lr = Cells.Find("*", Cells(Rows.Count, Columns.Count) _
, , , xlByRows, xlPrevious).Row

For i = 2 To lr
lr = Cells(Rows.Count, 1).End(xlUp).Row + 1
lc = Cells(i, Columns.Count).End(xlToLeft).Column
Cells(i, 2).Resize(, lc).Copy 'Cells(lr, 1)
Cells(lr, 1).PasteSpecial Paste:=xlPasteAll, Operation:=xlNone, _
SkipBlanks:=False, Transpose:=True
Next i

Columns(1).Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortTextAsNumbers
Application.ScreenUpdating = True
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Don Guillett" wrote in message news:...
sample?

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"BRB" wrote in message
...
I have inherited an excel file with numbers across 100 columns and over
300
rows with several blank cells (likely 15%). I would like to format these
numbers across 10 columns and however many rows are necessary, but
without
any blank cells, in ascending order down each column.
Can someone help me how to do this? Thank you.





All times are GMT +1. The time now is 01:20 PM.

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