Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
您好我正在使用 xlsxwriter 创建一个 xlsx 文件有没有办法使用这个对象创建一个 excel 公式?
您可以像编写值一样编写 Excel 公式。
例如:
import xlsxwriter workbook = xlsxwriter.Workbook('sample.xlsx') worksheet = workbook.add_worksheet() worksheet.write('A1', 2) worksheet.write('B1', '=A1*4') workbook.close()
现在电子表格单元格A1的值为 2,并且单元格B1使用公式=A1*4(即 8)。
A1
B1
=A1*4