vba - Sorting a Range of Data -


this code sorting range of data based on column e values

sub sortbylevel()     activeworkbook.worksheets("sheet1").sort.sortfields.clear    activeworkbook.worksheets("sheet1").sort.sortfields.add  key:=range("e13:e528" _     ), sorton:=xlsortonvalues, order:=xlascending, dataoption:=xlsortnormal     activeworkbook.worksheets("sheet1").sort       .setrange range("a12:l528")       .header = xlyes       .matchcase = false       .orientation = xltoptobottom       .sortmethod = xlpinyin       .apply   end  end sub 

note b12:l12 range of headers. have impression can more simpler that. suggestions appreciated. thanks, michael

use :

range("a12:l528").sort key1:=range("e13"), order1:=xlascending, header:=xlyes 

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -