You can merge multiple cells in a worksheet into a single cell by
following these steps:
- Select the cells that you want to merge.
- On the Formatting toolbar, click the Merge and Center tool. Or, click Cells on the Format menu, click the Alignment tab, click the Merge cells check box, and then click OK.
When you protect a worksheet, you can use the TAB key and SHIFT+TAB to
select the unlocked cells in the worksheet, one cell at a time in order.
However, if the
EnableSelection property of the worksheet is set to
xlUnlockedCells, cells that are adjacent to merged cells may not be selected.
The following steps demonstrate this problem:
- In Microsoft Excel, create a new workbook.
- In Sheet1, select cells B2:D4. On the Formatting toolbar, click the Merge and Center tool.
- Select cells B2:E5. On the Format menu, click Cells, and then click the Protection tab. Click to clear the Locked check box, and then click OK.
- On the Tools menu, point to Protection, click Protect Sheet, and then click OK.
- Select cell B2. Press TAB or SHIFT+TAB repeatedly.
NOTE: Each unlocked cell in the worksheet is selected as you press either the TAB key or SHIFT+TAB.
- On the Tools menu, point to Macro, and then click Visual Basic Editor.
- If the Project Explorer window is not visible, click Project Explorer on the View menu.
- In the Project Explorer, select the name of the worksheet (for
example, Sheet1).
- On the View menu, click Properties Window.
- In the box to the right of EnableSelection, click to select 1 - xlUnlockedCells.
- On the File menu, click Close and Return to Microsoft Excel.
- Select cell B2, and then press TAB repeatedly.
NOTE: Cells E3 and E4 are not selected; the selection cycles between cell E2 and cell B2.
- Select cell B5, and then press SHIFT+TAB repeatedly.
NOTE: Cells E2 and E3 are not selected; the selection cycles through cell E4, B2, E5, D5, C5, and then jumps back to B5.