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
  #1  
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
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.



Ads
 




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 12:37 PM.


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