Hi all,
I am trying to build a simple number formatting macro that would display negative numbers in parentheses e.g., -24000 should be shown as (24,000.00) or something like that. While I am able to accomplish said formatting change using Numberformat, the command is forcing the cell type to change from Number to Custom. Is there any chance that I can prevent this from happening?
Below the code I am using:
Any help appreciated,
Best,
Andreas
I am trying to build a simple number formatting macro that would display negative numbers in parentheses e.g., -24000 should be shown as (24,000.00) or something like that. While I am able to accomplish said formatting change using Numberformat, the command is forcing the cell type to change from Number to Custom. Is there any chance that I can prevent this from happening?
Below the code I am using:
Code:
Sub FormatNum_Coma_2Decim(control As IRibbonControl) Dim SelRange As Range
Set SelRange = Selection
SelRange.NumberFormat = "#,##0.00;(#,##0.00)"
End Sub
Any help appreciated,
Best,
Andreas