The second method: set the shortcut key for merging cells.
1. Click the triangle button under Quick Access Toolbar to open the drop-down menu, and click Other Commands in the drop-down menu.
2. In the Excel Options dialog box that appears, find "Center after consolidation" on the left, select it, click "Add", and finally click "OK" to add the "Center after consolidation" button to the quick access toolbar.
3. Click the Alt key at this time, and a number will be found on the merged center button in the quick access toolbar, so the shortcut key for the merged center is "Alt+6".