• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Java Excel automation cell background color repeating setFillForeground

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey all I have the code below that changes the background of a cell to either RED or GREEN. It seems that when I comment out the GREEN else code that my excel sheet has all red for each cell box in row 1. Likewise, if I do the opposite and comment out RED and un-comment GREEN then all the cells in row 1 are green.

I'm not understanding what in the code below is making it color all the cells the same color even though the first 2 cells should be RED while all the others should be GREEN. I already checked my logic and its going to the first IF 2 times and then the rest is going to the else so that's correct.

My code:


I'm sure I am just looking over something quite obvious but at this time I'm not able to find what that may be.

Any help would be great!

Note: Also posted to the following forums:

codeguru
Stackoverflow
 
You can't have everything. Where would you put it?
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic