Description:

You can Merge UnMerge Cell Range in Excel VBA, it is required if you want to make bigger cells, instead of existing cell to fit your data and needs.

Merge UnMerge Range in Excel VBA – Solution:

Merge UnMerge Cell Range in Excel VBA We can use Merge and UnMerge methods of a Range to Merge UnMerge Cell Range in Excel VBA.

Merge UnMerge Cell Range in Excel VBA – Example:

Following is the example to show you how to merge or UnMerge the cells in excel using VBA.

Code to merge Cells
Sub sbMergeRange()
Range("A1:B3").Merge
End Sub
Code to unmerge Cells
Sub sbUnMergeRange()
Range("A1:B3").UnMerge
End Sub
Instructions:
  1. Open an excel workbook
  2. Press Alt+F11 to open VBA Editor
  3. Insert a Module for Insert Menu
  4. Copy the above code and Paste in the code window
  5. Save the file as macro enabled workbook
  6. Press F5 to execute it

Hey! Join Our Community

Get Quick Responses & Experts' Answers in Minutes!
Get Notified - When Answered Your Question!