问题
I have to convert 2 columns in 20 excel files (same format) everyday. Is there a way in powershell to make it work. I searched for some examples but all point to change of Number format.
Current code:
$worksheet.columns.item('d').NumberFormat = "$#,##0.00"
The entire Workbook / Worksheet is in "General" format
Help is appreciated.
回答1:
As per comments, you can use @
to specify text formatting:
$worksheet.columns.item('d').NumberFormat = "@"
来源:https://stackoverflow.com/questions/45632765/powershell-excel-change-format-of-the-column-to-text