TheBoldRoller
TheBoldRoller

Reputation: 83

How to hide text in certain cells from a script?

Windows 10, Google Sheets, LVL: Rookie.

So I have a sheet, that is kinda like a scoreboard, the main purpose of it is to do scoreboard things, but that's irrelevant. Basically, for new people that use the sheet, I have green sentences near cells to show them what goes there, kinda like tutorials.

enter image description here

But, for people that have used the sheet for a while, they are going to get tired of all this extra space used up by green sentences that don't actually teach them anything cause they already know it.

SO I wanted to create a button from a UI box, that disables tutorials (Just hiding/deleting these green sentences), and whenever they wanted to see the tutorials "sentences" again, they could use another UI Button to enable them, which unhides/adds the text back in the cells.

I already have the UI Box setup...

enter image description here

The only thing I don't know how to do or what to code, is hiding/deleting these sentences, and being able to unhide/paste the sentences.

Now, if this can be done in an easy formula, please let me know, but otherwise, please help me write out a script for this. I will credit you if you wish.

Upvotes: 0

Views: 823

Answers (1)

Tedinoz
Tedinoz

Reputation: 7984

You have a complicated spreadsheet that included about 25 text "hints" to user. You want experienced users to have the ability to "hide" the hints if they wish.

You could do this with a checkbox.

  • Untick (the default): the comments appear.
  • Tick the box: the comments are hidden

  1. Create a checkbox (say, it is in Cell G1),
  2. Edit all your hints along these lines.

=if($G$1=TRUE,"","Team name goes here --->")

Explanation

  • $G$1=TRUE`: this means that the check box has been ticked
  • if TRUE, then display nothing: ""
  • if not TRUE (the checkbox is NOT ticked), then display the hint. Such as "Team name goes here --->"

Upvotes: 2

Related Questions