sort in Excel

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • MK

    #1

    sort in Excel

    Hello,

    Does anyone knows how to use the Excel sort function in python?

  • MK

    #2
    Re: sort in Excel

    u do it like this:

    from win32com.client import Dispatch
    xlApp = Dispatch("Excel .Application")
    xlApp.Workbooks .Open("D:\pytho n\sortme.csv")
    xlApp.Range("A1 :C100").Sort(Ke y1=xlApp.Range( "B1"), Order1=2)
    xlApp.ActiveWor kbook.Close(Sav eChanges=1)
    xlApp.Quit()
    del xlApp

    Comment

    Working...