Bird
Raised Fist0
Excelspreadsheet~10 mins

Merge and center cells 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 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.

Practice

(1/5)
1. What does the Merge and Center feature do in Excel?
easy
A. Copies the content of one cell to all selected cells.
B. Combines selected cells into one and centers the text inside.
C. Splits one cell into multiple cells and centers the text.
D. Deletes all selected cells and centers the remaining cells.

Solution

  1. Step 1: Understand the Merge and Center function

    This feature combines multiple selected cells into a single larger cell.
  2. Step 2: Understand text alignment after merging

    The text from the top-left cell is centered in the new merged cell.
  3. Final Answer:

    Combines selected cells into one and centers the text inside. -> Option B
  4. Quick Check:

    Merge and Center = Combine cells + center text [OK]
Hint: Merge cells to create one big cell with centered text [OK]
Common Mistakes:
  • Thinking it splits cells instead of merging
  • Assuming all cell contents are kept after merge
  • Believing it copies content to all merged cells
2. Which of the following is the correct way to merge and center cells in Excel?
easy
A. Select cells -> Data tab -> Merge & Center button
B. Select cells -> Insert tab -> Merge & Center button
C. Select cells -> Home tab -> Merge & Center button
D. Select cells -> Review tab -> Merge & Center button

Solution

  1. Step 1: Locate the Merge & Center button

    It is found on the Home tab in the Alignment group.
  2. Step 2: Apply merge and center

    Select the cells you want to merge, then click the Merge & Center button on the Home tab.
  3. Final Answer:

    Select cells -> Home tab -> Merge & Center button -> Option C
  4. Quick Check:

    Merge & Center button is on Home tab [OK]
Hint: Find Merge & Center on Home tab, Alignment group [OK]
Common Mistakes:
  • Looking for Merge & Center on wrong tabs
  • Trying to merge from Insert or Data tabs
  • Not selecting cells before clicking Merge & Center
3. You have cells A1, B1, and C1 with values "Sales", "2023", and "Q1" respectively. You select all three and click Merge and Center. What will be the content of the merged cell?
medium
A. The merged cell will be empty
B. "Sales 2023 Q1" combined in the merged cell
C. "Q1" centered across the merged cell
D. "Sales" centered across the merged cell

Solution

  1. Step 1: Understand which cell content remains after merging

    Only the content of the top-left cell (A1) remains after merging.
  2. Step 2: Check the content of the top-left cell

    Cell A1 contains "Sales", so this text will be centered in the merged cell.
  3. Final Answer:

    "Sales" centered across the merged cell -> Option D
  4. Quick Check:

    Top-left cell content remains after merge [OK]
Hint: Only top-left cell text stays after merge [OK]
Common Mistakes:
  • Assuming all cell texts combine after merge
  • Thinking the last cell's content remains
  • Expecting merged cell to be empty
4. You tried to merge cells A2 to C2 but got an error saying "Merge cells only works on contiguous cells." What is the most likely cause?
medium
A. You selected non-adjacent cells instead of a continuous range.
B. You forgot to select the cells before clicking Merge & Center.
C. You tried to merge cells with different data types.
D. You used the wrong tab to merge cells.

Solution

  1. Step 1: Understand the error message

    The error means the selected cells are not next to each other in a continuous block.
  2. Step 2: Check selection of cells

    Only contiguous (adjacent) cells can be merged, so selecting non-adjacent cells causes this error.
  3. Final Answer:

    You selected non-adjacent cells instead of a continuous range. -> Option A
  4. Quick Check:

    Merge requires contiguous cells [OK]
Hint: Select continuous cells only before merging [OK]
Common Mistakes:
  • Selecting cells with gaps between them
  • Trying to merge cells from different rows or columns non-contiguously
  • Ignoring the error message
5. You want to create a title across columns A to D that says "Monthly Report" centered in the merged cell. Which steps should you follow?
hard
A. Type "Monthly Report" in A1, select A1:D1, then click Merge & Center.
B. Type "Monthly Report" in A1, select B1:D1, then click Merge & Center.
C. Type "Monthly Report" in D1, select A1:D1, then click Merge & Center.
D. Type "Monthly Report" in A1, select A1:D1, then press Delete.

Solution

  1. Step 1: Enter the title text in the top-left cell

    Type "Monthly Report" in cell A1, which will be the content kept after merging.
  2. Step 2: Select the range to merge and apply Merge & Center

    Select cells A1 to D1 and click the Merge & Center button to combine and center the text.
  3. Final Answer:

    Type "Monthly Report" in A1, select A1:D1, then click Merge & Center. -> Option A
  4. Quick Check:

    Title in top-left cell + merge range + center [OK]
Hint: Type in top-left cell, select full range, then merge & center [OK]
Common Mistakes:
  • Typing text outside the top-left cell
  • Selecting wrong cells for merging
  • Deleting cells instead of merging