Sub hb()
Dim en&, i&, n&
en = [A1048576].End(3).Row
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Do While i <= en
i = i + 1
For n = i + 1 To en
If Cells(i, 1) <> Cells(n, 1) Or n = en Then
n = IIf(n = en, en, n - 1)
Range(Cells(i, 1), Cells(n, 1)).Merge
i = n
Exit For
End If
Next
Loop
Columns("a").VerticalAlignment = xlCenter
End Sub
Dim en&, i&, n&
en = [A1048576].End(3).Row
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Do While i <= en
i = i + 1
For n = i + 1 To en
If Cells(i, 1) <> Cells(n, 1) Or n = en Then
n = IIf(n = en, en, n - 1)
Range(Cells(i, 1), Cells(n, 1)).Merge
i = n
Exit For
End If
Next
Loop
Columns("a").VerticalAlignment = xlCenter
End Sub
2115

被折叠的 条评论
为什么被折叠?



