|
本帖最后由 laoau138 于 2017-10-28 09:45 编辑
VBA如何把所有合并单元格取消合并
- Sub aaa()
- Dim rng As Range
- Application.FindFormat.MergeCells = True
- Application.ScreenUpdating = False
- Set rng = Cells.Find(What:="", LookIn:=xlFormulas, LookAt:=xlPart, SearchFormat:=True)
- Do
- With rng.MergeArea
- .MergeCells = False
- .Value = rng
- End With
- Set rng = Cells.Find(What:="", After:=rng, SearchFormat:=True)
- If rng Is Nothing Then Exit Do
- Loop
- Application.ScreenUpdating = True
- End Sub
复制代码
|
|