The line of code
Range("B12:" & lLastRow).Select
should be
Range("B12:M" & lLastRow).Select
--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
"HelpMe " wrote in message
...
Thanks for the help but I am getting an error and not sure how
to solve
it! It Says *Method 'Range' of object '_Global'
failed*.
Here is the code I am using.
Sub Sorty()
Dim lLastRow As Long
lLastRow = Range("M65536").End(xlUp).Row
Range("B12:" & lLastRow).Select
Selection.Sort Key1:=Range("D12"), Order1:=xlAscending,
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End Sub
Thanks for any help!
---
Message posted from http://www.ExcelForum.com/