Script that changes background of a range base on text in a cell

14 views
Skip to first unread message

Peter Cox

unread,
Apr 29, 2020, 7:38:20 AM4/29/20
to Google Apps Script Community
Hello, a newby hier in programming in google sheets

is it possible that a script can look in a cell for the typed color ( say green) in Cell F6 and then use a color( say green or some other color) for the background in the range F1:F6 . The script must start to run if the value from G6 is changed

So if there is a way to create a loop so the script is looking in the cells from say F6:F300

The link is a smal piece of my document

 thanks for thinking with me



Michael O'Shaughnessy

unread,
May 1, 2020, 11:00:49 PM5/1/20
to google-apps-sc...@googlegroups.com
Here is a quick little spreadsheet example: https://docs.google.com/spreadsheets/d/1InkKDHRZ2q-ERQf5AMDzaNAEu23lsbfV5w8hnQrYe-0/edit?usp=sharing 

As long as you use a "web safe" and "CSS" approved color name it should work.

NOW, there is NO error trapping so you will want to add that.

Hope this helps!

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/79db889b-c195-41b9-9f88-f97ae5b100fe%40googlegroups.com.

Peter Cox

unread,
May 2, 2020, 4:36:28 AM5/2/20
to Google Apps Script Community
Sorry MRO.Michael,

the sheet is View only.  I can't see the script.
So you make me very curious. Let me know when you change the rights

Peter

Op zaterdag 2 mei 2020 05:00:49 UTC+2 schreef mro.michael:
Here is a quick little spreadsheet example: https://docs.google.com/spreadsheets/d/1InkKDHRZ2q-ERQf5AMDzaNAEu23lsbfV5w8hnQrYe-0/edit?usp=sharing 

As long as you use a "web safe" and "CSS" approved color name it should work.

NOW, there is NO error trapping so you will want to add that.

Hope this helps!

On Wed, Apr 29, 2020 at 7:38 AM Peter Cox <badm...@gmail.com> wrote:
Hello, a newby hier in programming in google sheets

is it possible that a script can look in a cell for the typed color ( say green) in Cell F6 and then use a color( say green or some other color) for the background in the range F1:F6 . The script must start to run if the value from G6 is changed

So if there is a way to create a loop so the script is looking in the cells from say F6:F300

The link is a smal piece of my document

 thanks for thinking with me



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-community+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages