We help IT Professionals succeed at work.
Get Started

PEAR Spreadsheet_Excel_Writer addformat

Last Modified: 2012-05-05
Is it possible to add to a default format for a single cell and retain the original format for the remaining cells.
e.g. I have a default format lets say size 10, align right
I'm printing out a table of numbers which i want all to use the default format above.

But my question is can i add another pice of formating to the default for specific cells
e.g. numbers over 10 are blue
                      over 20 are red
                      over 30 are green

my table is printing out fine with the correct default format, but if i go to add another format(with the same name) it just overwrites the previous formatting.

i've also tried setFgColor to the original format but this changes the default format and is applied to all the cells.
I've also tried 2 write statements, but again this overwrites the existing format.

So basically is it possible to apply 2 formats to a cell, 1 default and 1 depending on cell value????

Please Help
Watch Question
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE