Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
excel app.range().sort()
#1
Hello ,
I have a problem sorting 4 columns in excel. I want to be able to sort it by the first column then by the second and all ascending order.

I've tried to play with it a bit but it always gives me sort method of range class failed.

Here is the sample

Macro Macro2
Code:
Copy      Help
ExcelSheet es1.Init
Excel.Application app=es1.ws.Application
app.Range("A:D").Sort(app.Range("A:A") Excel.xlAscending app.Range("B:B") Excel.xlAscending 0 0 Excel.xlGuess 1 0 Excel.xlSortColumns 0 0 0 0 0)

Any help appreciated !
Thank you.

Sergiu
#2
this works
Macro Macro2230
Code:
Copy      Help
ExcelSheet es1.Init
Excel.Application app=es1.ws.Application
app.Range("A:D").Sort(app.Range("A:A") Excel.xlAscending app.Range("B:B") @ Excel.xlAscending @ 1 Excel.xlGuess @ 0 Excel.xlSortColumns 0 0 0 0)
#3
I wish you a big sack filled with euros ! Smile


Forum Jump:


Users browsing this thread: 1 Guest(s)