gbcbooks has asked for the wisdom of the Perl Monks concerning the following question:
i want to let excel autoselect cell's bg_color when its value is normal ,it turns green , alternative , it turns red. please guide me a way.our $dest_book = Spreadsheet::WriteExcel->new("Report.xls"); my $diskusage = $dest_book->add_worksheet("01-diskcheck"); my $c3format = $dest_book->add_format(); my $lightgreen = $dest_book->set_custom_color(41,10,255,133); $c3format->set_valign('vcenter'); $c3format->set_align('center'); $c3format->set_border('1'); $c3format->set_bg_color($lightgreen); $diskusage->write('F2','=IF(E2<D2,"normal","failed")',$c3format); $diskusage->write('F3','=IF(E3<D3,"normal","failed")',$c3format); $diskusage->write('F4','=IF(E4<D4,"normal","failed")',$c3format); $dest_book->close();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: set color base on cell's value in your Excel
by blindluke (Hermit) on Nov 12, 2015 at 14:11 UTC | |
by gbcbooks (Initiate) on Nov 13, 2015 at 05:56 UTC | |
by blindluke (Hermit) on Nov 13, 2015 at 09:24 UTC |