Apple Numbers, change background

I have a big Apple Numbers file. Each row has a different color and each color has a meaning. Is there a way I can change the colors in an automatic way? For instance, can I say: change red backgrounds to blue background.


(Of course, I know how to do that one by one, but that will take a long way and there is the possibility of many mistakes. I am asking to automate the process. Something like the find and replace but applied to the background color)

Posted on Dec 19, 2017 8:23 AM

Reply
10 replies
Sort By: 

Dec 20, 2017 3:44 AM in response to NarcisMG

Hi Narcis, and welcome to the Numbers for Mac forum.

You wrote:

now I want to polish and make a better design.

Good!

I have struggled with ways to answer your question, but I keep wondering about Barry's three points:

  • When you do this one-by-one, how did you decide to make the 'red' rows red?
  • How do you decide later to change the 'red' rows' colour to blue?
  • Automation of the change needs a set of rules governing the colour to be used.

Please give more information. That will help us to help you.


Regards,

Ian.


Edit: I started with this,

User uploaded file

but I don't know the rules for which colour. Ian.

Reply

Dec 21, 2017 12:58 AM in response to NarcisMG

For the example tables you gave above, colouring the rows (using two colours) is simple to do with conditional highlighting:

User uploaded file

But unless every cell in the row contains the key text "normal" or "important" or a third "word" to trigger the third colour, this won't do what you want it to do.


"Simplified this is what I have now. To change the background I go to Inspector > Format > Cell and I pick up the color."


"What did you do" is not what I asked. I asked "how did you decide" in both questions.


In the (over) "simplified" example shown above, my answer to the first question could be 'I decided to fill a cell red if I saw the the text "important"in that cell,'

and my answer to the second could be 'I decided to change the fill colour from red to green if the text "important' was no longer in the cell, and I saw the text "normal" in the cell.


So I'll rephrase the question:


What key is available in the row that can be used to determine whether the cells in that row should be filled with colour 1, colour 2, colour 3, or not filled with any colour at all?


Regards,

Barry

Reply

Dec 19, 2017 9:41 AM in response to NarcisMG

Hi Narcis,


When you do this one-by-one, how did you decide to make the 'red' rows red?

How do you decide later to change the 'red' rows' colour to blue?

Automation of the change needs a set of rules governing the colour to be used.


"Each row has a different color and each color has a meaning."

How many different colours are used?


In general, you can control fill colour of a cell with a conditional highlight rule applied to that cell, or with a script which takes it's cue from the contents of one cell and sets the fill colour of a specified group of cells (in this case, a row) according to a set of 'rules' built into the script.


Conditional highlight rules compare the content of the cell to be formatted to a specific value written into the rule, or to the value in another cell. Rules (one for each possible colour for that cell) are evaluated in the order listed, and the first rule whose condition is met determines the colour applied to that cell.


Conditional highlighting is automatic, and always 'live'. Scripts wait for you to start them, then make the changes mandated in the script, then quit and wait to be started again for the next round.


As in most things, 'the devil's in the details', starting with:


Which version of OS X/macOS? (Apple menu > About this Mac)

Which version of Numbers? (Numbers menu > About Numbers)


Answers to questions at the beginning of this post.


Regards,

Barry

Reply

Dec 20, 2017 2:29 AM in response to Barry

macOS High Sierra 10.13.2

Numbers 4.3.1


There are three colors in all the documents. Each color means a degree of priority. The relation is just conventional. Those are several documents, it all began just for me. It has grown and now I want to polish and make a better design.

Reply

Dec 20, 2017 4:38 AM in response to Yellowbox

Simplified this is what I have now. To change the background I go to Inspector > Format > Cell and I pick up the color.

this raw is normal

this raw is normal

this raw is normal

this is important

this is important

this is important

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this is important

this is important

this is important

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal






This is what I want. I want a color that is not in the first options so, there is one step more: I go to Inspector > Format > Cell > Pencils > I choose the color



this raw is normal

this raw is normal

this raw is normal

this is important

this is important

this is important

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this is important

this is important

this is important

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal

this raw is normal




Reply

Dec 21, 2017 2:01 AM in response to Barry

The text in each row is different, there is no correlation between the text and the color that a machine can determine. I cannot make any search of text to choose the color. The only option is to find a background color and replace by another color.

Reply

Dec 21, 2017 3:17 AM in response to NarcisMG

"There are three colors in all the documents. Each color means a degree of priority."


"The only option is to find a background color and replace by another color."


So EVERY row that was at one degree of priority will always change en masse to one of the other degrees of priority? For example, EVERY row that was Red will change to Blue?


Your initial description, "I have a big Apple Numbers file," implies there are several rows of each colour.


What you want cannot be done using conditional highlighting. Highlighting rules depend on comparing the content of the cell to be formatted with a specific value, or with the contents of another cell. Colour fill is 'Format'. 'Format' is not 'Content.'


What you want might be doable using an AppleScript. AppleScript is certainly capable of changing the colour fill of a series of cells. It may or may not be capable of detecting the current colour fill of a cell. For the answer to that, you'll need the attention of someone capable of writing an AppleScript.


Some questions:

You've specified three colours, and have named two, red and blue. To make the questions more concrete, let's assume the third colour is the third rgb primary, green.


To date in the conversation you have mentioned (twice) changing red to blue.

Does that mean the colour change always follows this pattern:


red —> blue

blue —> green

green —> red

…etc.


OR


Is this a possible series of colour changes for a set of rows:


red —> blue —> red —> green —> red —> green…


IF the first (the colour change is always in the same 'direction':


Assuming the first change is Red to blue.

After the red to blue change has occurred, the cells that were red are now blue. The cells that were blue are still blue. Do all of these blue cells change to green? (and in the next step, to red?)


If not, how will Numbers (or the AppleScript) know which cells have just been turned blue, and which were blue when this process started?


Regards,

Barry

Reply

Dec 22, 2017 4:20 PM in response to NarcisMG

"It's like the example I give: change one row that has one color to another color."


It's not 'like the example you give:" The table shown in your first response to Yellowbox has two rows whose cells are filled with yellow, not one. In the second image, both rows that were yellow-filled in the first image are now grey-filled.


Your initial post says "(Of course, I know how to do that one by one, but that will take a long way and there is the possibility of many mistakes. I am asking to automate the process. Something like the find and replace but applied to the background color)" which does not lead easily to "change one row that has one color to another color."


Simple for you, perhaps, but you know which row to change from one colour to which specific other colour.


You're still not addressing the biggest block to doing this automatically.


Read through the full discussion again. Pay particular attention to the questions that have been asked.


Regards,

Barry

Reply

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Apple Numbers, change background

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.