Hardeep
Run this macro based upon contents of Column A
Sub Clear_Stuff()
'Based on code by Sandy Mann July 1st, 2007
Dim LastRow As Long
Dim x As Long
LastRow = Cells(Rows.Count, 1).End(xlUp).Row
Application.ScreenUpdating = False
For x = LastRow To 2 Step -1
If Cells(x, 1).Value = Cells(x - 1, 1).Value Then
If Cells(x - 1, 1).Value <> "" Then
If Cells(x - 1, 1).Value <> "" Then
Cells(x, 1).EntireRow.ClearContents
End If
End If
End If
Next x
Application.ScreenUpdating = True
End Sub
Does not merge and center, but clears contents of duplicated row.
You don't want merge and center because only the data in the top left cell of
selected cells will remain.
i.e. if you selected A2
2 and merged, only A2 data would remain.
Gord Dibben MS Excel MVP