Home > Back-end >  Change the appearance of drop downs
Change the appearance of drop downs

Time:11-14

Dropdowns are useful, but they would be even more useful if the dropdown options could be formatted. For example, using bold or italic text for various selections, or changing the background color of other options on the dropdown display.

It's easy to have a cell formatting change according to the dropdown selected, but that's not what I'm trying to do. I want the formatting of the the dropdown items to be different than simple plain text.

CodePudding user response:

I'm not sure changing the colour of data validation options is possible, but you can exploit the fact that Unicode fonts include italic and bold versions in their extended character sets, and use these characters instead of the usual ones to achieve some of what you want. Use an online tool like (for instance) https://yaytext.com/bold-italic/ to give you the bold/italic versions of your required text options, and add these to your validation list.

CodePudding user response:

It sounds like you are asking for a way to change the appearance of the control that appears when you click the dart in a drop-down cell. The built-in controls in Google Sheets cannot be customized that way.

To implement your own custom controls, use Apps Script to implement a custom dialog box or a sidebar.

CodePudding user response:

A simple script that, for example by selecting a value in a column 5 (change), changes the formatting of the text? Or do you want the text in the validation to be changed?

function onEdit(e) {
if(e.range.getRow()>1 && e.range.getColumn() ==5){
e.source.getActiveRange()
 .setFontSize(11)
 .setFontWeight('bold')
 .setFontStyle('italic')
 .setFontLine('line-through')
 .setFontColor('#ff0000')
 .setBackground('#ffff00')
  };
 }
  • Related