MyCuteHeart
New Member
- Joined
- Mar 7, 2012
- Messages
- 6
Hi Guyz,
Been recording a macro that sorts different columns at a time but after recording it and tried the macro, it always give me an error and does not do the sorthing. See below part of the code where it gives an error. Please help. Thanks a lot.
Text in bold is the one making the error.
Range("D2:D31").Select
ActiveWorkbook.Worksheets("jag2_ptr_thermal prt rev10 03_0").Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("jag2_ptr_thermal prt rev10 03_0").Sort.SortFields. _
Add Key:=Range("D2:D31"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal
Been recording a macro that sorts different columns at a time but after recording it and tried the macro, it always give me an error and does not do the sorthing. See below part of the code where it gives an error. Please help. Thanks a lot.
Text in bold is the one making the error.
Range("D2:D31").Select
ActiveWorkbook.Worksheets("jag2_ptr_thermal prt rev10 03_0").Sort.SortFields. _
Clear
ActiveWorkbook.Worksheets("jag2_ptr_thermal prt rev10 03_0").Sort.SortFields. _
Add Key:=Range("D2:D31"), SortOn:=xlSortOnValues, Order:=xlAscending, _
DataOption:=xlSortNormal