[Solved] Change color of text in a cell from input in a cell

Discuss the spreadsheet application
Post Reply
sksmaster56
Posts: 6
Joined: Sat Aug 12, 2017 9:53 pm

[Solved] Change color of text in a cell from input in a cell

Post by sksmaster56 »

Hello everyone,
I think it is obvious that I am new to this forum. I have been a loyal Oo user for years now and have received much help from the forums. This is my first post so please bare with me.

I have been trying to understand how to change the color of text in one cell from input in another cell. I found what I thought was the answer but for some reason I can't get it to work =IF(condition;"PASS";"FAIL")&T(STYLE(IF(condition;"Green_Style";"Red_Style"))).
I have created a spreadsheet for my business and so far it has done what I want it to do until now. What i want to do is take a name from a drop down list in one cell and apply a color change to text in another.
A11 is a list box with

D
FD
PC
MI
Van
TC
AoT
SB
SH

C11 is the cell i would like to change the color in. So if A11 is "SB" or "SH" then turn the text in C11 to green. If A11 is AoT then turn the text in C11 to Blue. Everything else will leave C11 red.

Thank you in advance for your help and understanding of a forum newbe
test01.ods
part of my business spreadsheet
(14.94 KiB) Downloaded 132 times
Last edited by sksmaster56 on Tue Aug 15, 2017 10:05 pm, edited 1 time in total.
OpenOffice 4.1.1
Windows 7 Pro
User avatar
robleyd
Moderator
Posts: 5084
Joined: Mon Aug 19, 2013 3:47 am
Location: Murbko, Australia

Re: change color of text in a cell from input in another cel

Post by robleyd »

The solution proposed in Cell background color change will work for you also.
Cheers
David
OS - Slackware 15 64 bit
Apache OpenOffice 4.1.15
LibreOffice 24.2.2.2; SlackBuild for 24.2.2 by Eric Hameleers
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: change color of text in a cell from input in another cel

Post by Zizi64 »

Here is your modified example file. I created some more styles (in Hierarchical order, because the Child styles can inherit properties from the Parend style), and I applied them by the function STYLE() in Column E, and then I applied them by the Conditional Format feature in the Column F.
test01_Zizi64.ods
(18.61 KiB) Downloaded 133 times
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sksmaster56
Posts: 6
Joined: Sat Aug 12, 2017 9:53 pm

Re: change color of text in a cell from input in another cel

Post by sksmaster56 »

Zizi64,
Thanks for your help but for some reason I cant get it to work the way I want it to.
I am sending a whole sheet. B11-B60 should be black. That is the place where I put what the driver got paid. C11-C60 is the credit if the customer paid with a credit card. If C11 has "Aot" "SB" "SH" then those are in house credit that will be billed. I tried to use the formula after i made some styles but it doesnt change the color of C11. It puts the number wherever I put the formula and applies the color change there. I have put the formula in V11-V60. When you see the whole sheet you may understand more of what I need. Thank you
OpenOffice 4.1.1
Windows 7 Pro
sksmaster56
Posts: 6
Joined: Sat Aug 12, 2017 9:53 pm

Re: change color of text in a cell from input in another cel

Post by sksmaster56 »

I forgot to attach the sheet so here it
Attachments
Newest Dispatch sheet 08-12-17.ods
(16.26 KiB) Downloaded 92 times
OpenOffice 4.1.1
Windows 7 Pro
User avatar
Zizi64
Volunteer
Posts: 11360
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Change color of text in a cell from input in another cel

Post by Zizi64 »

I tried to use the formula after i made some styles but it doesnt change the color of C11.
If the C11 has a numeric content that YOU typed-in, then you can not use a FORMULA in the C11 (because it is contains a numeric value). In this case you must use the "Conditional Format" way instead of the "apply a STYLE() by a formula".
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
sksmaster56
Posts: 6
Joined: Sat Aug 12, 2017 9:53 pm

Re: Change color of text in a cell from input in another cel

Post by sksmaster56 »

Thank You Zizi64, I will try that
OpenOffice 4.1.1
Windows 7 Pro
sksmaster56
Posts: 6
Joined: Sat Aug 12, 2017 9:53 pm

Re: Change color of text in a cell from input in another cel

Post by sksmaster56 »

Zizi64,
I guess I am not understanding conditional formatting. I will keep trying.
OpenOffice 4.1.1
Windows 7 Pro
sksmaster56
Posts: 6
Joined: Sat Aug 12, 2017 9:53 pm

Re: Change color of text in a cell from input in another cel

Post by sksmaster56 »

Thank you Zizi64, conditional formatting worked.
OpenOffice 4.1.1
Windows 7 Pro
Post Reply