Last active
January 2, 2016 21:49
-
-
Save zhimiaoli/8365813 to your computer and use it in GitHub Desktop.
取消Excel中合并单元格的代码
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub UnMergeFill() | |
'from http://stackoverflow.com/questions/9215022/unmerging-excel-rows-and-duplicate-data | |
Dim cell As Range, joinedCells As Range | |
on error resume next | |
For Each cell In ThisWorkbook.ActiveSheet.UsedRange | |
If cell.MergeCells Then | |
Set joinedCells = cell.MergeArea | |
cell.MergeCells = False | |
joinedCells.Value = cell.Value | |
End If | |
Next | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment