I have a worksheet that I run a list of macros from, and a sheet called Orders.xls that is edited by the worksheet. It has 4 columns, and a maximum of 3000 rows. I recorded a macro to sort the invoices by column D, by product number. This macro does not error, but does not sort any data. An example of what it sorts is below, also with the macro I am trying.
Data needing sorted:
PRODUCT PRODUCT PRODUCT PRODUCT
CODE NAME COUNT NUMBER
----- ----- ----- -----
PHT PHOTOS 129 8
PRN PRINTER 1 139
PHN PHONE 3 23
Result of sort:
PRODUCT PRODUCT PRODUCT PRODUCT
CODE NAME COUNT NUMBER
----- ----- ----- -----
PHT PHOTOS 129 8
PHN PHONE 3 23
PRN PRINTER 1 139
If anyone is able to assist, it would be greatly appreciated. Thank you!
Data needing sorted:
PRODUCT PRODUCT PRODUCT PRODUCT
CODE NAME COUNT NUMBER
----- ----- ----- -----
PHT PHOTOS 129 8
PRN PRINTER 1 139
PHN PHONE 3 23
Result of sort:
PRODUCT PRODUCT PRODUCT PRODUCT
CODE NAME COUNT NUMBER
----- ----- ----- -----
PHT PHOTOS 129 8
PHN PHONE 3 23
PRN PRINTER 1 139
Code:
Windows("ORDERS.xls").Activate
Sheets("ORDERS").Range("A4:D3000").Select
Cells.Sort Key1:=Range("D4"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Comment