I have a Python script that writes an Excel table. I want to sort the table by the Attribute Name
How the script works:
import openpyxl
from openpyxl import workbook
from openpyxl import load_workbook
from openpyxl.worksheet.table import Table
Data = [[A,20,1,1000],[B,20,1,1000],[A,20,1,900],[B,20,1,900],[A,20,1,1100],[B,20,1,1100]]
wb = openpyxl.Workbook()
ws = wb.active
ws.append(['Name','%','Mode','Value'])
for row in Data:
ws.append(row)
table = Table(displayName = 'Results', ref ='A1:D7')
ws.add_table(table)
There must be something like:
table.sort('Name', upwards)
But I can't find the needed function.