3

I have created Excel sheet and written data into Excel file.

Do we have any functionality for sort column using openpyxl? I could not attach Excel sheet and droping one row of excel sheet:

0   -269.9  99.97   0   -25.58  0   0.0006901   -269.9  127 0   26.23   0   810 -269.9
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
user765443
  • 1,856
  • 7
  • 31
  • 56
  • See https://stackoverflow.com/a/46313587/1072869 or https://stackoverflow.com/questions/34247373/sort-a-range-of-cells-win32com-client to see how to sort using `win32com` – Aralox Sep 20 '17 at 04:59

1 Answers1

9

I'm pretty sure there is no such thing in openpyxl or xlwt or even xlsxwriter (but if you're on windows, you can do it via win32com and Excel.Application).

Usually, you should just read the data from the excel file, sort it in python and write the data back.

See similar questions:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • 2
    This is correct. I can confirm that sorting **isn't** part of the file format and thus can't be done with the Python Excel file creation modules. – jmcnamara May 02 '13 at 15:23