vb

Tags:

This is another example to create a Macro to Merge and De-Merge the selected cells quickly, which is otherwise a long procedure.

Steps to create a Macro for Merge

1. Start Macro Recorder and name it as "MergeCells"
2. Select the cells you want to merge. You can also select two blank cells.
3. Click on "Merge and Centre" button on the Formatting toolbar.
4. Stop the Macro Recorder.

Press ALT + F11 and open the Visual Basic Editor. You will see that the following code is generated.

Sub MergeCells()
'
' MergeCells Macro
' Macro recorded 3/7/2008 by Ravi Sagar
'