Sep-16-2018, 05:15 AM
I have the following code to set the font in my excel table using openpyxl:
Could someone please give me a tip? (I know that centre in American is 'center'
!
ft1 = Font(name='Arial', size=20) for sheet in targetFileSheetNames: targetFileActiveSheet = targetFile[sheet] maxRow = targetFileActiveSheet.max_row maxCol = targetFileActiveSheet.max_column for colNum in range(2, maxCol + 1, 1): for rowNum in range(1, maxRow + 1): targetFileActiveSheet.cell(row=rowNum, column=colNum).font = ft1I would also like to have the text in the middle of the cell. I can't see how to set that.
Could someone please give me a tip? (I know that centre in American is 'center'
