mplees
Active Member
- Joined
- Feb 6, 2006
- Messages
- 351
Hi came across this code on the internet (I think originally created by Mike Rickson):
This almost does what I need - it unmerges all the merged cells, but each of the unmerged cells repeats the data that was originally in the merged cells. Is it possible to modify the code so that the cells are unmerged, but only the first of each unmerged cells contains the data?
Hope someone can help me out
Regards
Mark
Code:
Dim oneCell As Range, onesFriends As Range
With ThisWorkbook.Activesheet
For Each oneCell In .UsedRange
If oneCell.MergeCells Then
Set onesFriends = oneCell.MergeArea
oneCell.UnMerge
onesFriends.Value = oneCell.Value
End If
Next oneCell
End With
This almost does what I need - it unmerges all the merged cells, but each of the unmerged cells repeats the data that was originally in the merged cells. Is it possible to modify the code so that the cells are unmerged, but only the first of each unmerged cells contains the data?
Hope someone can help me out
Regards
Mark