Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/excel/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用win32 python将excel中的数据列格式化为百分比_Python_Excel_Winapi_Format_Pywin32 - Fatal编程技术网

使用win32 python将excel中的数据列格式化为百分比

使用win32 python将excel中的数据列格式化为百分比,python,excel,winapi,format,pywin32,Python,Excel,Winapi,Format,Pywin32,尝试在excel中使用win32 python将数据列转换为百分比 xlSheet.Range("C3:C7").Style = "Percentage" 这是行不通的。还有别的办法吗?你差点就成功了 正确的格式名称是“百分比” 因此,请尝试: xlSheet.Range("C3:C7").Style = "Percent" 谢谢我离得很近,但我不会得到它!用百分比转换,比如说0.170691到17%,有没有办法使17.07%变成17.07%xlSheet.Range(“C3:C7”)。Nu

尝试在excel中使用win32 python将数据列转换为百分比

xlSheet.Range("C3:C7").Style = "Percentage"
这是行不通的。还有别的办法吗?

你差点就成功了

正确的格式名称是
“百分比”

因此,请尝试:

xlSheet.Range("C3:C7").Style = "Percent"

谢谢我离得很近,但我不会得到它!用百分比转换,比如说0.170691到17%,有没有办法使17.07%变成17.07%
xlSheet.Range(“C3:C7”)。NumberFormat=“0.00%”
可以满足您的需要。