A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Sorting a list of numbers

Thread Tools Display Modes
Old June 5th, 2010, 03:05 PM posted to microsoft.public.excel.misc
Don Guillett[_2_]
external usenet poster
Posts: 607
Default Sorting a list of numbers

Option Explicit
Sub SASLineEmUP()
Dim lr As Long
Dim i As Long
Dim lc As Long
Application.ScreenUpdating = False
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, _
Application.ScreenUpdating = True
End Sub

Don Guillett
Microsoft MVP Excel
SalesAid Software

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

Don Guillett
Microsoft MVP Excel
SalesAid Software

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


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

All times are GMT +1. The time now is 02:45 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright 2004-2019 OfficeFrustration.
The comments are property of their posters.