Tigerexcel
Active Member
- Joined
- Mar 6, 2020
- Messages
- 493
- Office Version
- 365
- 2019
- Platform
- Windows
This macro highlights the blanks within the range but doesn't actually delete any rows and I can't work out why. There's most likely more coding here than there needs to be so happy to take any feedback on that.
VBA Code:
Sub dellirow()
Dim rng As Range
Dim rw As Range
Dim usedrange As Range
Set rng = ActiveSheet.usedrange
rng.SpecialCells(xlCellTypeBlanks).Select
For Each rw In rng.Rows
If WorksheetFunction.CountA(rng.EntireRow) = 0 Then
rng.EntireRow.Delete
End If
Next rw
End Sub