Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Failed to save table attributes of (null) into (null). | Excel Discussion (Misc queries) | |||
VB macro != NUll expression | Excel Programming | |||
Change macro to hide row if null | Excel Programming | |||
Handling a Null Cell in Macro | Excel Programming | |||
Handling Null Field in Macro Loop | Excel Programming |