sort macro not working

Joined
Sep 18, 2012
Messages
1
Reaction score
0
This is to copy from sheet1 then paste to sheet2 then sort the data in descending order with reference to column A. But the problem is that data data in sheet2 is not sorting, nothing is happening


Sheets("Sheet1").Select
Sheets("Sheet1").Range("A:K").Select
Selection.Copy

Sheets("Sheet2").Select
Sheets("Sheet2").Range("A1").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False

Sheets("Sheet2").Range("A:K").Select
Selection.AutoFilter
Range("A:K").Sort Key1:=Range("A2"), Order1:=xlDescending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
 
Joined
Sep 19, 2012
Messages
11
Reaction score
0
Works for me. Initially I took out the Selection.AutoFilter line (commented it out) to test but after that was fine.
 

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

Top