bruingjt
asked on
How do I use Open Office Calc to change the background color of cell range A2:F2 based on the value of cell D2?
I want to change the background color of cells A2:F2 based on the value of cell D2. The kicker is that cell D2 could be any of 15 values. Is there a way to do this?
Thanks for your help in advance.....
Joey
Thanks for your help in advance.....
Joey
ASKER
Okay, I think I'm able to follow what this is doing, and it works great for Row 2. Forgive me though, but how can I make this loop through the entire sheet to set the color for each row based on the value in Column D?
Thanks,
Joey
Thanks,
Joey
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
Thank you so much. That worked great! Column D will always be the data check and the row will be colored based on the value of cell D in each row. Thanks again!!!
Joey
Joey
Below is the start of a Macro that you can adapt to meet your needs. You will need to add conditions to the Case statement for all your conditions and chosen background colors. To insert the Macro into your document:
Press Alt=F11 for Macros (or from the menu Tools >> Macros >> Organize Macros >> OpenOffice.org Basic)
Click on your sheet name in the tree on the left.
Click the New Button
Enter a module name or leave it as Module1
Click OK
In the Editor, paste the code below over the default code
Save your document
Now modify the code to fit and save again
Let me know if you have questions
-Bear
Open in new window