How to Merge Cells Quickly in Excel - Fastest Way to Merge Cells


Hi,

In this article you will learn about how to merge cells quickly in excel by using micro. You can save your time by using this easy method so the below steps you can follow to merge cells in excel very quickly.



 Open the sheet where you wanna merge cells

 •  Go to view tab>> Micros>>Record Micro>>Click ok



•  Go back to view tab >> Micros >> Click on Stop Recording


•  Now go to developer tab >> open visual basic 


• Select Module 1, remove the existing code and  paste below VBA code (VBA code given below)


• Go back to data sheet, select the area you want to merge
• Open >> Micros >> View Micros and click on run



• So it will merge all of your data having same values

Hope you will find this video useful...!
Thank you

VBA Code:

Option Explicit

Sub Merge_Same_Cells()

Application.DisplayAlerts = False

Dim rng As Range

MergeCells:

For Each rng In Selection

If rng.Value = rng.Offset(1, 0).Value And rng.Value <> "" Then
Range(rng, rng.Offset(1, 0)).Merge
Range(rng, rng.Offset(1, 0)).HorizontalAlignment = xlCenter
Range(rng, rng.Offset(1, 0)).VerticalAlignment = xlCenter
GoTo MergeCells
End If
Next

End Sub

    Download Micro 

Post a Comment

Post a Comment (0)

Previous Post Next Post