(filename)
inverts all cells in a workbook
    Args:
        filename (str): excel file to invert cells in
    Returns:
        None
inverts all cells in a workbook
    Args:
        filename (str): excel file to invert cells in
    Returns:
        None
inverts all cells in a workbook Args : filename ( str ) : excel file to invert cells in Returns : None
def invertCells(filename):
    """inverts all cells in a workbook
    Args:
        filename (str): excel file to invert cells in
    Returns:
        None
    """
    wb = openpyxl.load_workbook(filename)
    sheet = wb.active
    newSheet = wb.create_sheet(index=0, title='inverted')

    for rowObj in sheet.rows:
        for cellObj in rowObj:
            colIndex = cellObj.column
            rowIndex = cellObj.row

            newSheet.cell(row=colIndex, column=rowIndex).value = cellObj.value

    wb.save('result_'+filename)
def invertCells ( filename ) : wb = openpyxl . load_workbook ( filename ) sheet = wb . active newSheet = wb . create_sheet ( index = 0 , title = 'inverted' ) for rowObj in sheet . rows : for cellObj in rowObj : colIndex = cellObj . column rowIndex = cellObj . row newSheet . cell ( row = colIndex , column = rowIndex ) . value = cellObj . value wb . save ( 'result_' + filename )