|
Sub 合并()<br/> Dim lStart&, lEnd&<br/> Dim i&<br/> lStart = 2<br/> Application.DisplayAlerts = False<br/> For i = 3 To Range("A65536").End(xlUp).Row + 1<br/> If Cells(i, 1) <> Cells(i - 1, 1) Then<br/> lEnd = i - 1<br/> If lEnd > lStart Then<br/> Range(Cells(lStart, 1), Cells(lEnd, 1)).Merge<br/> lStart = i<br/> End If<br/> End If<br/> Next i<br/> Application.DisplayAlerts = True<br/>End Sub |
|