Excel – forcing excel to display a negative number as ($0,000)

excelvba

how do i do this in vba?

and how do i do this manually?

Best Solution

You can set the number format of a cell to a custom format like:

ActiveCell.NumberFormat = "0;(0)"

That will put parentheses around negative numbers.

If you want to display it exactly like ($0,000) you can do that with

ActiveCell.NumberFormat = "0;(""$0,000"")"

You can set the custom format manually through the Format Cells dialog.