简体   繁体   English

如何使用XLSX Writer设置Excel文件的限制

[英]How to set limitations for excel file with xlsx writer

I want to generate an excel using python xlsxwriter module with the header, so that others can fill data in it. 我想使用带有标头的python xlsxwriter模块生成一个excel,以便其他人可以在其中填充数据。 I am able to generate excel but, I want to restrict the user to enter only 5digits in a column. 我能够生成excel,但是我想限制用户在列中仅输入5位数字。 How to achieve this? 如何实现呢? Even I set column width, it is not reflecting. 即使设置了列宽,它也不能反映出来。

You can do this with the Excel Data Validation option in XlsxWriter. 您可以使用XlsxWriter中的Excel数据验证选项来执行此操作。

See the Working with Data Validation section of the docs and this example . 请参阅文档的“使用数据验证”部分和此示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何使用 Python pandas/XLSX 编写器将数据的边框设置为 excel - How to set borders to the data to the excel with Python pandas/XLSX writer 如何使用XLSX Writer动态写入Excel - How to write into excel dynamically using xlsx writer Xlsx Writer也没有创建excel文件但也没有创建错误 - Xlsx Writer not creating excel file but not creating an error either 使用xlsx writer将图像从sqlite导出到Excel文件 - Export images from sqlite to Excel file using xlsx writer 使用 Spreadsheett::ParseXLSX 从 .xlsx 文件复制单元格格式以使用 EXCEL:WRITER::XLSX 编写另一个单元格? - Copy the cell format from .xlsx file using Spreadsheett::ParseXLSX to write another cell using EXCEL:WRITER::XLSX? 如何将 excel (.xlsx) 文件读入 pyspark dataframe - How to read excel (.xlsx) file into a pyspark dataframe 如何在 python 中使用 xlsx 编写器注释工作 - how to use xlsx writer anotation work in python 使用XLSX Writer将数据透视表写入Excel工作簿范围 - Write Pivot Table to Excel Workbook Range using XLSX Writer 使用 Xlsx Writer 在 excel 中的特定列、行中写入嵌套字典 - writing nested dictionary in specific column , row in excel using Xlsx Writer 如何在 excel 中查找单词(字符串)是否存在于 excel 文件(xlsx)中? - how to find a word(string) in excel whether it is present in excel file (xlsx) or not?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM