0
0
Excelspreadsheet~10 mins

Cell alignment and wrapping in Excel - 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 horizontal alignment of cell A1 to center.

Excel
Range("A1").HorizontalAlignment = [1]
Drag options to blanks, or click blank then click option'
AxlCenter
BxlLeft
CxlRight
DxlJustify
Attempts:
3 left
💡 Hint
Common Mistakes
Using xlLeft or xlRight instead of xlCenter
Confusing horizontal with vertical alignment
2fill in blank
medium

Complete the code to enable text wrapping in cell B2.

Excel
Range("B2").[1] = True
Drag options to blanks, or click blank then click option'
ATextWrapping
BWrapText
CWrap
DTextWrap
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect property names like TextWrap or Wrap
Forgetting to set the property to True
3fill in blank
hard

Fix the error in the code to set vertical alignment of cell C3 to bottom.

Excel
Range("C3").VerticalAlignment = [1]
Drag options to blanks, or click blank then click option'
AxlMiddle
BxlCenter
CxlBottom
DxlTop
Attempts:
3 left
💡 Hint
Common Mistakes
Using xlMiddle or xlCenter which center vertically
Using xlTop which aligns content to the top
4fill in blank
hard

Fill both blanks to set cell D4 to wrap text and align horizontally to right.

Excel
With Range("D4")
  .[1] = True
  .HorizontalAlignment = [2]
End With
Drag options to blanks, or click blank then click option'
AWrapText
BxlLeft
CxlRight
DWrap
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Wrap' instead of 'WrapText'
Using xlLeft instead of xlRight for horizontal alignment
5fill in blank
hard

Fill all three blanks to set cell E5 to wrap text, align vertically center, and horizontally justify.

Excel
With Range("E5")
  .[1] = True
  .VerticalAlignment = [2]
  .HorizontalAlignment = [3]
End With
Drag options to blanks, or click blank then click option'
AWrapText
BxlCenter
CxlJustify
DWrap
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Wrap' instead of 'WrapText'
Mixing up vertical and horizontal alignment constants
Using xlCenter for horizontal alignment instead of xlJustify