Home
Forums
New posts
Search forums
Articles
Latest reviews
Search resources
Members
Current visitors
Newsgroups
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Misc
Sort a column in Excel 2007
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Dave Peterson, post: 12698138"] Option Explicit Sub testme() Dim iRow As Long Dim FirstRow As Long Dim LastRow As Long Dim HowManyPerGroup As Long Dim wks As Worksheet Set wks = Worksheets("Sheet1") HowManyPerGroup = 5 With wks FirstRow = 1 ' no headers LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For iRow = FirstRow To LastRow Step HowManyPerGroup .Cells(iRow, "A").Resize(HowManyPerGroup, 1).Copy .Cells(iRow, "B").PasteSpecial Transpose:=True Next iRow 'clean up original data .Columns(1).Delete 'clean up empty rows On Error Resume Next .Columns(1).Cells.SpecialCells(xlCellTypeBlanks).EntireRow.Delete On Error GoTo 0 End With End Sub [/QUOTE]
Verification
Post reply
Home
Forums
Newsgroups
Microsoft Excel
Microsoft Excel Misc
Sort a column in Excel 2007
Top