tags:

views:

103

answers:

2

how do i do this in vba?

and how do i do this manually?

+1  A: 

You can do it easily with a cell formula. =IF(A1<0, 0, A1)

Ben
+3  A: 

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.

HakonB