ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort Macro Start On Row 7 Until Null (https://www.excelbanter.com/excel-programming/398960-sort-macro-start-row-7-until-null.html)

Joe K.

Sort Macro Start On Row 7 Until Null
 

I trying to create a macro that will sort column K in descending order with
all of the other columns included, data starts on row 7 until row is empty
(null or "").

Lines 1-6 have header information.

Thanks so much for the help with this macro.



joel

Sort Macro Start On Row 7 Until Null
 
You didn't specify which columns. fixt this statement in code below for
your range of columns

A = Startcolumn
M = End column
Set SortRange = Range("A7:M" & LastRow)



Sub Macro3()
'
' Macro3 Macro
' Macro recorded 10/9/2007 by Joel
'

'
LastRow = Cells(Rows.Count, "K").End(xlUp).Row
Set SortRange = Range("A7:M" & LastRow)
SortRange.Sort Key1:=Range("K7"), _
Order1:=xlAscending, _
Header:=xlGuess, _
MatchCase:=False, _
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub


"Joe K." wrote:


I trying to create a macro that will sort column K in descending order with
all of the other columns included, data starts on row 7 until row is empty
(null or "").

Lines 1-6 have header information.

Thanks so much for the help with this macro.




All times are GMT +1. The time now is 03:11 AM.

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