bingie
asked on
Custom Cell Format VIA VBA Macro
I'm currently using the following as a custom cell format:
"_($* #,##0.00_);[Red]_($* -#,##0.00_);_($* " - "??_);_(@_)"
Instead of right-clicking the cell and setting this format using the cell properties, I would like to set this via a VBA macro.
I have tried
But that doesn't work.
Alternatively, I have also tried
Essentially, I would like to format (via vba macro) the range of cells as currency with 2 decimal places, $ sign, comma ($1000) separator and red if negative.
Thanks
"_($* #,##0.00_);[Red]_($* -#,##0.00_);_($* " - "??_);_(@_)"
Instead of right-clicking the cell and setting this format using the cell properties, I would like to set this via a VBA macro.
I have tried
Range("H:K").Select
Range("H:K").FormatConditions = "_($* #,##0.00_);[Red]_($* -#,##0.00_);_($* " - "??_);_(@_)"
orSelection.NumberFormat = "_($* #,##0.00_);[Red]_($* -#,##0.00_);_($* " - "??_);_(@_)"
But that doesn't work.
Alternatively, I have also tried
Range("H:K").Select
Selection.Style = "Currency"
But that doesn't show negative numbers in red or show the negative sign (it formats with brackets).Essentially, I would like to format (via vba macro) the range of cells as currency with 2 decimal places, $ sign, comma ($1000) separator and red if negative.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Kevin!