

To merge cells and center the contents with VBA, use a macro with the following statement structure: #3: Merge Cells and Center VBA Code to Merge Cells and Center The merged cell range (A5 to E6) was originally merged using the macro example #1 above. As expected, the merged cell containing cell C6 is unmerged into individual regular cells. The following GIF illustrates the results of executing this macro example. Worksheets("Merge Cells").Range("C6").UnMerge The following macro unmerges the merged cell containing cell C6 of the worksheet named “Merge Cells”. Description: Separates the merged cell containing the cell you specify in item #2 above into individual regular cells.Specify the cell using an A1-style cell reference (A1CellReference) enclosed within quotations (“”).


You can find additional VBA and Macro Tutorials in the Archives.
