0
0
Google Sheetsspreadsheet~10 mins

Borders and background colors in Google Sheets - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the background color of cell A1 to yellow using Apps Script.

Google Sheets
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange('A1').setBackground([1]);
Drag options to blanks, or click blank then click option'
A"yellow"
B"blue"
C"red"
D"green"
Attempts:
3 left
💡 Hint
Common Mistakes
Forgetting to put the color name inside quotes.
Using an invalid color name.
2fill in blank
medium

Complete the code to add a solid border around the range B2:D4.

Google Sheets
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange('B2:D4').setBorder(true, true, true, true, false, false, [1], null);
Drag options to blanks, or click blank then click option'
A"dashed"
B"double"
C"dotted"
D"solid"
Attempts:
3 left
💡 Hint
Common Mistakes
Using a border style that is not supported.
Passing the style in the wrong argument position.
3fill in blank
hard

Fix the error in the code to set the background color of range C3:C5 to light gray.

Google Sheets
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange('C3:C5').setBackground([1]);
Drag options to blanks, or click blank then click option'
A"lightgray"
B"#D3D3D3"
Clightgray
D#D3D3D3
Attempts:
3 left
💡 Hint
Common Mistakes
Not putting the color code inside quotes.
Using an invalid color name.
4fill in blank
hard

Fill both blanks to add a solid blue top and bottom border to range E1:E3.

Google Sheets
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange('E1:E3').setBorder(true, false, true, false, false, false, [1], [2]);
Drag options to blanks, or click blank then click option'
A"solid"
B"dashed"
C"red"
D"blue"
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up the order of style and color arguments.
Using color names where style is expected.
5fill in blank
hard

Fill both blanks to set a green left and right border with a dotted border style on range F4:F6.

Google Sheets
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getRange('F4:F6').setBorder(false, true, false, true, false, false, [1], [2]);
Drag options to blanks, or click blank then click option'
A"dotted"
B"green"
C"yellow"
D"solid"
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing the order of style and color arguments.
Using unsupported border styles.