【发布时间】:2018-04-07 19:18:16
【问题描述】:
NumberFormat 似乎是一个简单的函数,但我无法让它工作是一个相当简单的案例。在下面的代码中,VBA 告诉我“类型不匹配”。
For j = 1 To last_column + 1
For f = 2 To total_tranches + 1
If allocation(f - 1, j - 1) = Empty And j <> 1 Then
Allo1.Cells(AlShares.Row - 1 + f, j + 1) = 0
Else
Allo1.Cells(AlShares.Row - 1 + f, j + 1) = allocation(f - 1, j - 1)
If j = 1 Then Allo1.Cells(AlShares.Row - 1 + f, j + 1).IndentLevel = 1
If j = 2 Then Allo1.Cells(AlShares.Row - 1 + f, j + 1).NumberFormat = "_($*#,##0_);_($*(#,##0);_($*" - "??_);_(@_)"
End If
Next f
Next j
如果我用“会计”替换特定格式,它就不起作用。请帮忙!
【问题讨论】:
标签: vba excel number-formatting