Sort Macro Start On Row 7 Until Null

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top