-
display negative values as $0.00
This code is subtracting one value with another, but if the results are negative, how can I display the value as $0.00?
[VBA]frmPDCalc.DL8B.Caption = Format(CCur(Replace(Replace(frmPDCalc.EL6B.Caption, "$", ""), ",", "")) - CCur(Replace(frmPDCalc.Test7B.Caption, "*", "")), "$##,###0.00")[/VBA]
-
The format string
"$##,###0.00";$0.00;$0.00"
should work
Paul
-
For example[VBA] MsgBox Format(Application.Max(2.3567 - 3.9834, 0), "$##,###0.00")
MsgBox Format(Application.Max(10.3567 - 3.9834, 0), "$##,###0.00")
MsgBox Format(Application.Max(2.3567 - 2.3567, 0), "$##,###0.00")[/VBA]
Artik
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules