Excel 2013 Macro Code: Merge or UnMerge Cells
From SolverBase.com
Problem
- How to merge or unmerge Excel cells by using VBA macro code?
- What is the macro code / VBA code to merge or unmerge Excel cells?
Solution
For Example you want to merge cells from E1 to E5.
- Paste below Code in the VBA code window.
Sub Example() Range("E1:E5").Merge End Sub
For Example you want to unmerge cells from E1 to E5.
- Paste below Code in the VBA code window.
Sub Example() Range("E1:E5").UnMerge End Sub
If you don't know how to open VBA code window then use the following link...