快速合并单元格
Sub 合并相同内容的连续单元格()
Dim i As Long
Application.DisplayAlerts = False
For i = Range("a1").End(xlDown).Row To 2 Step -1
If Cells(i, 1).Value = Cells(i - 1, 1).Value Then
Range(Cells(i, 1), Cells(i - 1, 1)).Merge
End If
Next i
Application.DisplayAlerts = True
End Sub
快速解除合并单元格
Sub 取消合并单元格()
Dim i As Long, k As Integer
For i = 2 To 14
With Cells(i, 1)
k = .MergeArea.Count
.UnMerge
.Resize(k, 1).Value = .Value
End With
i = i + k - 1
Next i
[b2:b14].Copy
Range("a2:a14").PasteSpecial xlPasteFormats
Application.CutCopyMode = False
[e1].Select
End Sub
https://pan.baidu.com/s/14NMX3pwGaNNKGtXVHPt9uQ
联系客服