Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. Sub UnMergeFill(ByVal ws As Worksheet)
  2.  
  3. Dim cell As Range, joinedCells As Range
  4.  
  5. For Each cell In ws.UsedRange
  6. If cell.MergeCells Then
  7. Set joinedCells = cell.MergeArea
  8. cell.MergeCells = False
  9. joinedCells.Value = cell.Value
  10. End If
  11. Next
  12.  
  13. End Sub
  14.  
  15. sub UnMergeFillAllSheets()
  16. Dim ws As Worksheet
  17. for Each ws In Worksheets
  18. UnMergeFill ws
  19. Next
  20. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement