EXCEL取消合并且等于原合并值

2019-02-27 13:25:36 浏览数 (2)

方法一:

选中有合并单元格的区域,

例如:B4:B69,取消合并,然后在选中状态下编辑定位定位条件空值,确定后会在B5出现反白,输入等号后点B4,按住CTRL键回车.

方法二: Sub 取消合并且等于原合并值() If Selection.Count = 1 Then MsgBox "请选择合并单元格再执行本工具!", 64, "友情提示": Exit Sub Application.ScreenUpdating = False On Error GoTo err Dim RNG As Range, val, CELL As String For Each RNG In Application.Intersect(Selection, ActiveSheet.UsedRange) If RNG.MergeCells Then CELL = RNG.MergeArea.Address val = RNG.Value RNG.UnMerge Range(CELL).Value = val End If Next Application.ScreenUpdating = True Exit Sub err: MsgBox "请选择带有合并单元格的区域,但不要全选工作表!", 64, "友情提示" End Sub

转载请注明:积木居 » EXCEL取消合并且等于原合并值

0 人点赞