Excel 2016 VBA recorded sub doesn't sort -
i trying sort table in vba, doesn't work. when record macro, works fine during recording, table gets sorted. if run recorded macro module, doesn't sort. here's recorded code:
sub macro3() activeworkbook.worksheets("sheet1").listobjects("tdpm").sort.sortfields _ .clear activeworkbook.worksheets("sheet1").listobjects("tdpm").sort.sortfields _ .add key:=range("tdpm[site id]"), sorton:=xlsortonvalues, order:= _ xlascending, dataoption:=xlsortnormal activeworkbook.worksheets("sheet1").listobjects("tdpm").sort .header = xlyes .matchcase = false .orientation = xltoptobottom .sortmethod = xlpinyin .apply end end sub
Comments
Post a Comment