write in excel as ( ) replace the minus sign
for example if it 12345.78-
the code replace in excel as (12345.78)
thanks in advance.
Printable View
write in excel as ( ) replace the minus sign
for example if it 12345.78-
the code replace in excel as (12345.78)
thanks in advance.
TryCode:Worksheets("Sheet1").Columns("C"). _
NumberFormat = "$#,##0.00_);($#,##0.00)"
i tried this one it does not work it works but the excel should show with () does not show this one
NumberFormat = "_(* #,##0.00_);_(* (#,##0.00);_(* ""-""??_);_(@_)"
What are you exactly typing in Excel?
1275.50-
Unless cell was formated as number with trailing-minus, when entering 1275.50- that will be treated as text.
You need to convert that look-like-number-text to a number so the first 3 sections of the number format can be applied.
The quickest way is to use the built-in method TextToColumns to convert with
TrailingMinusNumbers:=True
Code:Columns("A:A").NumberFormat = "_(#,##0.00_);(#,##0.00);_(""-""??_);_(@_)"
Columns("A:A").TextToColumns Destination:=Range("A1"), _
DataType:=xlDelimited, _
Tab:=False, Semicolon:=False, Comma:=False, Space:=False, Other:=False, _
FieldInfo:=Array(1, 1), TrailingMinusNumbers:=True