Bird
Raised Fist0
Excelspreadsheet~10 mins

Borders and shading in Excel - Interactive Code Practice

Choose your learning style10 modes available

Start learning this pattern below

Jump into concepts and practice - no test required

or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to add a border around the selected cells.

Excel
Selection.Borders.LineStyle = [1]
Drag options to blanks, or click blank then click option'
AxlContinuous
BxlNone
CxlDash
DxlDot
Attempts:
3 left
💡 Hint
Common Mistakes
Using xlNone removes borders instead of adding them.
Choosing xlDash or xlDot creates dashed or dotted borders, not solid.
2fill in blank
medium

Complete the code to shade the selected cells with a yellow background color.

Excel
Selection.Interior.Color = [1]
Drag options to blanks, or click blank then click option'
ARGB(255, 255, 0)
BRGB(255, 0, 0)
CRGB(0, 255, 0)
DRGB(0, 0, 255)
Attempts:
3 left
💡 Hint
Common Mistakes
Using red or blue RGB values instead of yellow.
Confusing the order of RGB parameters.
3fill in blank
hard

Fix the error in the code to apply a thick border to the bottom edge of the selected cells.

Excel
Selection.Borders(xlEdgeBottom).Weight = [1]
Drag options to blanks, or click blank then click option'
AxlMedium
BxlThick
CxlThin
DxlHairline
Attempts:
3 left
💡 Hint
Common Mistakes
Using xlThin or xlMedium which are thinner than thick.
Using xlHairline which is very thin.
4fill in blank
hard

Fill both blanks to set the font color to red and apply a dashed border style to the selected cells.

Excel
Selection.Font.Color = [1]
Selection.Borders.LineStyle = [2]
Drag options to blanks, or click blank then click option'
ARGB(255, 0, 0)
BxlContinuous
CxlDash
DRGB(0, 0, 255)
Attempts:
3 left
💡 Hint
Common Mistakes
Using continuous border style instead of dashed.
Using wrong RGB values for red.
5fill in blank
hard

Fill all three blanks to apply a green fill color, set the border color to blue, and use a dotted border style.

Excel
Selection.Interior.Color = [1]
Selection.Borders.Color = [2]
Selection.Borders.LineStyle = [3]
Drag options to blanks, or click blank then click option'
ARGB(0, 255, 0)
BRGB(0, 0, 255)
CxlDot
DxlContinuous
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up RGB values for green and blue.
Using continuous border style instead of dotted.

Practice

(1/5)
1. What is the main purpose of adding borders to cells in Excel?
easy
A. To hide the contents of cells
B. To change the font style of the text inside cells
C. To calculate the sum of numbers in cells
D. To add lines around cells to separate and organize data

Solution

  1. Step 1: Understand what borders do

    Borders add visible lines around cells to separate or highlight data areas.
  2. Step 2: Compare options

    Only To add lines around cells to separate and organize data describes adding lines around cells; others describe unrelated features.
  3. Final Answer:

    To add lines around cells to separate and organize data -> Option D
  4. Quick Check:

    Borders separate data = A [OK]
Hint: Borders draw lines around cells to organize data visually [OK]
Common Mistakes:
  • Confusing borders with font or calculation features
  • Thinking borders hide data
  • Mixing borders with shading effects
2. Which of the following is the correct way to add a thick border around a selected cell in Excel?
easy
A. Go to Home tab > Font group > Click Borders dropdown > Select Thick Box Border
B. Right-click cell > Format Cells > Number tab > Choose Thick Border
C. Insert tab > Shapes > Draw thick border manually
D. Data tab > Sort & Filter > Apply Thick Border

Solution

  1. Step 1: Locate border options in Excel

    Border settings are found under Home tab in the Font group via the Borders dropdown.
  2. Step 2: Identify the correct method for thick border

    Go to Home tab > Font group > Click Borders dropdown > Select Thick Box Border correctly describes selecting Thick Box Border from the Borders dropdown.
  3. Final Answer:

    Go to Home tab > Font group > Click Borders dropdown > Select Thick Box Border -> Option A
  4. Quick Check:

    Correct border menu location = B [OK]
Hint: Borders are under Home > Font > Borders dropdown [OK]
Common Mistakes:
  • Looking for borders under Format Cells Number tab
  • Trying to draw borders with Shapes instead of border tool
  • Confusing border options with sorting or filtering
3. If you apply a yellow fill color (shading) to cells A1 to A3 and then add a border only to cell A2, what will be the visible result?
medium
A. Only cell A2 will have a border, and all three cells will have yellow shading
B. All three cells will have borders and yellow shading
C. Only cell A2 will have yellow shading and border
D. No cells will show shading or borders

Solution

  1. Step 1: Understand shading application

    Applying yellow fill to A1:A3 colors all three cells' backgrounds yellow.
  2. Step 2: Understand border application

    Adding border only to A2 means only that cell shows border lines.
  3. Final Answer:

    Only cell A2 will have a border, and all three cells will have yellow shading -> Option A
  4. Quick Check:

    Shading applies to range, border applies to single cell = A [OK]
Hint: Shading applies to selected cells; borders apply individually [OK]
Common Mistakes:
  • Assuming borders apply to all shaded cells automatically
  • Thinking shading only applies to cells with borders
  • Confusing fill color with border color
4. You tried to add a border to a cell, but no border appears. Which of these is the most likely reason?
medium
A. The cell is locked and cannot have borders
B. The border color is set to white, matching the background
C. Borders only work on merged cells
D. You applied the border but did not click outside the cell to see it

Solution

  1. Step 1: Check common border visibility issues

    Border may be invisible if its color matches the cell background.
  2. Step 2: Evaluate other options

    Cells can have borders regardless of locking; borders show immediately; borders work on all cells, not just merged.
  3. Final Answer:

    The border color is set to white, matching the background -> Option B
  4. Quick Check:

    Invisible border due to color = D [OK]
Hint: Check border color if borders don't show [OK]
Common Mistakes:
  • Thinking cell locking prevents borders
  • Believing borders appear only after clicking outside
  • Assuming borders only work on merged cells
5. You want to highlight a table by shading alternate rows light gray and adding a thin border around the entire table. Which steps correctly achieve this?
hard
A. Use the Fill Color tool to shade the whole table gray, then add Outside Borders only
B. Manually shade every other row, then add thick borders to each cell individually
C. Select the table, use Conditional Formatting to shade alternate rows, then select the table and add All Borders with thin line
D. Select the table, add thick borders, then use Conditional Formatting to shade all rows

Solution

  1. Step 1: Shade alternate rows using Conditional Formatting

    Conditional Formatting can automatically shade alternate rows for clarity.
  2. Step 2: Add thin borders around entire table

    Select the table and apply All Borders with a thin line style to outline all cells.
  3. Final Answer:

    Select the table, use Conditional Formatting to shade alternate rows, then select the table and add All Borders with thin line -> Option C
  4. Quick Check:

    Conditional Formatting + All Borders = C [OK]
Hint: Use Conditional Formatting for shading, Borders dropdown for lines [OK]
Common Mistakes:
  • Manually shading rows is slow and error-prone
  • Using thick borders instead of thin for subtle look
  • Only adding Outside Borders misses inner cell lines