vba - Sort Excel columns through COM from LotusScript -


i have lotusscript agent creates excel spreadsheet notes documents, 5 columns, this:

vendor name  plan year   plan month   project name       store advantage    2013        2            dairy_biproducts   136 kraft        2013        2            dairy_biproducts   330 daymon       2013        2            dairy_biproducts   382 advantage    2013        2            dairy_biproducts   398 daymon       2013        2            dairy_biproducts   616 advantage    2013        2            dairy_biproducts   691 

the following line sorts sheet:

sheet.columns.entirecolumn.sort sheet.cells(2, 1), 1, , , , , , 1, 1, false, 1, 

and ends giving me first , second columns sorted (although @ moment second column contains "2013" way down, don't know if line of code or not sorting column).

i got sort end of line here, can't find documentation method signature, have no idea each argument stands for, , how change sort spreadsheet way want. documentation can find using sort method directly vb, seems work differently.

i'd sort each of 5 columns: first first column, second, etc. how can this?

have try record operation in excel , in created macro?

activeworkbook.worksheets("sheet1").sort.sortfields.clear activeworkbook.worksheets("sheet1").sort.sortfields.add key:=range("d3:d8"), _ sorton:=xlsortonvalues, order:=xlascending, dataoption:=xlsortnormal activeworkbook.worksheets("sheet1").sort.sortfields.add key:=range("e3:e8"), _ sorton:=xlsortonvalues, order:=xlascending, dataoption:=xlsortnormal activeworkbook.worksheets("sheet1").sort.sortfields.add key:=range("f3:f8"), _ sorton:=xlsortonvalues, order:=xlascending, dataoption:=xlsortnormal activeworkbook.worksheets("sheet1").sort.sortfields.add key:=range("g3:g8"), _ sorton:=xlsortonvalues, order:=xlascending, dataoption:=xlsortnormal

with activeworkbook.worksheets("sheet1").sort     .setrange range("d3:g8")     .header = xlguess     .matchcase = false     .orientation = xltoptobottom     .sortmethod = xlpinyin     .apply end 

Comments

Popular posts from this blog

Unable to remove the www from url on https using .htaccess -