【问题标题】:Trying to use Powershell to format Excel spreadsheet with parentheses as negative numbers尝试使用 Powershell 将带括号的 Excel 电子表格格式化为负数
【发布时间】:2020-02-27 21:59:26
【问题描述】:

我对 Powershell 非常陌生,正在尝试将我在 excel 中的数据从负数转换为带括号的数字。有人可以帮我吗?

例如,单元格 A1 中的 -4,414,757 我想成为 (4,414,757)。谢谢!

【问题讨论】:

    标签: excel powershell formatting numbers


    【解决方案1】:

    您需要将单元格的数字格式更改为常规。

    $ExcelWorksheet.Cells("A1").NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
    

    【讨论】:

    • 感谢@BigBen。已更新。
    猜你喜欢
    • 2021-12-08
    • 2013-11-04
    • 1970-01-01
    • 2014-02-11
    • 1970-01-01
    • 2022-11-01
    • 2020-09-09
    • 1970-01-01
    • 2018-11-23
    相关资源
    最近更新 更多