网上问不到,然后自己摸索出来了。
style.Custom = "[$$] #,##0.00_);([$$] #,##0.00)"
这可以显示美元符,并且负值用()括住,不显示负号
然后用一个条件格式把负值时红色显示
Dim conditionIndex As Integer = fcs.AddCondition(FormatConditionType.CellValue, OperatorType.Between, "-1000000", "-0.01")
'Dim fc As FormatCondition = fcs.get(idx)
Dim fc As FormatCondition = fcs(conditionIndex)
'fc.setFormula1("0")
'fc.setOperator(OperatorType.LessThan)
'Sets the background color.
fc.Style.Custom = cstyle.Custom
fc.Style.Font.Color = Color.Red
??