Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Excel - how do I format negative Costs in Red

by hominid (Priest)
on Feb 02, 2010 at 13:52 UTC ( [id://820944]=note: print w/replies, xml ) Need Help??


in reply to Excel - how do I format negative Costs in Red

Not sure if this is the direction that you want to go, but I have done something similar using Excel's conditional formatting. Here is an example that sets the font to red for all cells in the selected range that have a value less than zero:
.... $Sheet->Range("A1")->{Value} = '$5.00'; $Sheet->Range("B1")->{Value} = '$-3.51'; $Sheet->Range("C1")->{Value} = '$-0.01'; my $selection = $Sheet->Range("A1:C1"); $selection->{FormatConditions}->Delete; $selection->{FormatConditions}->Add(xlCellValue, xlLess, "0"); $selection->FormatConditions(1)->Font->{ColorIndex} = 3; ...

Replies are listed 'Best First'.
Re^2: Excel - how do I format negative Costs in Red
by merrymonk (Hermit) on Feb 02, 2010 at 14:40 UTC
    I could use that if all else fails.
    I guess I was hoping that a diffrent format definition would have done the trick but then perhaps not!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://820944]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (2)
As of 2024-04-20 03:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found