Column adjust data types

500 views
Skip to first unread message

AL

unread,
Mar 23, 2022, 2:24:01 PM3/23/22
to openpyxl-users
Hello,

Is there any way to use openpyxl to change the data type of a column to, say, "Accounting"?  I know that you can use the '#,##0.00€' etc formatting but this is not what I want because that makes the number become a string and then it produces all those green triangles in the cells when I send the excel doc to someone else.

I want to be able to select a column and change it to "Accounting" using openpyxl (or any other python-based library) just like I can do in the excel app.  Is this possible?

Thanks in advance!
-AL

jeff

unread,
Mar 23, 2022, 2:57:23 PM3/23/22
to openpyxl-users
A proper format code should work to prevent the green warning triangles from displaying when the workbook is opened in Excel. Are you assigning the cell values as strings? They should be numbers, without the currency character.

There isn't a column-level assignment option for data type specification. You have to change the formatting of each individual cell separately.


Jeff

Reply all
Reply to author
Forward
0 new messages