Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 743
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings, I have a VBA which does work, but it is incredible slow. I'm trying to delete rows containing merged cells. The name of the work sheet is "Database". Any suggestions to speed this process along? Thank you,
VBA Code:
Sub DeleteMergedCells()
Dim w As Worksheet
Dim r As Range
Application.DisplayAlerts = False
For Each w In Worksheets
If w.Name <> "x" And w.Name <> "y" Then
With w
For Each r In .UsedRange
If r.MergeCells Then r.Delete
Next r
End With
End If
Next w
Application.DisplayAlerts = True
End Sub