fastest way to merge duplicate cells in without looping Excel
问题 I have cells containing duplicate values that i want to merge quickly. The table looks like this: Sub MergeCells() Application.DisplayAlerts = False Dim n As Name Dim fc As FormatCondition Dim Rng As Range, R As Range Dim lRow As Long Dim I&, J& Dim arr As Variant ReDim arr(1 To 1) As Variant With ThisWorkbook.Sheets("tst") Set Rng = .Range("A2:D11") lRow = Rng.End(xlDown).Row For J = 1 To 4 For I = lRow To 2 Step -1 'last row to 2nd row If Trim(UCase(.Cells(I, J))) = Trim(UCase(.Cells(I - 1,