I'm working on Chapter 12 of Automate the Boring Stuff with Python and it is about working with spreadsheets using openpyxl. I have an object called 'c' that is 'B1' of the spreadsheet. Whenever I use 'c.column' it returns the number '2' instead of the letter 'B'. The example on the page returns the letter so I'm wondering why mine is different.
I found a solution. Openpyxl has utilities to solve this problem, so here is the solution.
from openpyxl.utils import get_column_letter
then c.column can be passed in the function get_column_letter(c.column) which will return the letter instead of the number.
How to return column letters instead of column numbers with openpyxl?