View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default Fomat with Code Q

Sub dk()
For Each c In ActiveSheet.UsedRange.Cells
If c.Value < 0 Then
c.NumberFormat = "$#,##0.00_);[Red]($#,##0.00)"
End If
Next
End Sub



"Seanie" wrote in message
...
I wish to format an existing sheet so that all negative values show in
red. This seems simple, but I have a few problems:-

1) Its a very large sheet and,
2) I can't format all ranges within a column as I have dates in some
rows which I wish to leave as is

How then could I format via code:-

So a negative value would shows as -1,234.56 (in red)
And a postive value would shows as 1,234.56 (in black)