Question : excel macro to merge cells in one column based on condition
Answered by : sonam-vaish
Sub M() Set Sh = Sheets("Sheet1") Lastrow = Sh.Cells(Rows.Count, "E").End(xlUp).Row For i = 5 To Lastrow If Sh.Range("E" & i).Value = "Yearly" Then 'Application.DisplayAlerts = False 'Uncomment If you Dont need error msg to pop Sh.Range("J" & i & ":U" & i).Merge End If Next
End Sub
Source : https://forum.ozgrid.com/forum/index.php?thread/139580-merge-cells-based-on-the-condition/ | Last Update : Fri, 03 Jun 22