0
0
Excelspreadsheet~10 mins

Merge and center cells 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 merge and center the selected cells in Excel.

Excel
Selection.[1]
Drag options to blanks, or click blank then click option'
AMergeCells
BCenterAcrossSelection
CMergeAndCenter
DMerge
Attempts:
3 left
💡 Hint
Common Mistakes
Using only 'MergeCells' merges but does not center.
Using 'CenterAcrossSelection' does not merge cells.
Using 'Merge' alone is not a valid method.
2fill in blank
medium

Complete the VBA code to merge cells A1 to C1 and center the content.

Excel
Range("A1:C1").[1]
Drag options to blanks, or click blank then click option'
AMergeCells = True
BMergeAndCenter
CMergeCells
DMerge = True
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'MergeAndCenter' which is a method, not a property.
Using 'Merge' which is not a valid property.
Not assigning True to the MergeCells property.
3fill in blank
hard

Fix the error in the code to merge and center cells B2 to D2.

Excel
With Range("B2:D2")
  .MergeCells = True
  .HorizontalAlignment = [1]
End With
Drag options to blanks, or click blank then click option'
ACenter
BxlCenter
CCenterAcrossSelection
DxlMergeCenter
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Center' which is not a VBA constant.
Using 'CenterAcrossSelection' which is a different alignment.
Using 'xlMergeCenter' which does not exist.
4fill in blank
hard

Fill both blanks to merge cells E3 to G3 and center the content horizontally.

Excel
With Range("E3:G3")
  .[1] = True
  .HorizontalAlignment = [2]
End With
Drag options to blanks, or click blank then click option'
AMerge
BxlCenter
CCenter
DMergeCells
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Merge' instead of 'MergeCells'.
Using 'Center' instead of 'xlCenter' for alignment.
5fill in blank
hard

Fill all three blanks to merge cells H4 to J4, center horizontally, and vertically.

Excel
With Range("H4:J4")
  .[1] = True
  .HorizontalAlignment = [2]
  .VerticalAlignment = [3]
End With
Drag options to blanks, or click blank then click option'
AMerge
BxlCenter
CxlCenterAcrossSelection
DMergeCells
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Merge' instead of 'MergeCells'.
Using 'xlCenterAcrossSelection' which is not for vertical alignment.