How come neither of the attached VBAs to delete empty rows in the attached sheet do not work? Thank you in advance for your help.
VBA Code:
Sub Delete_empty_rows()
Columns("C:C").SpecialCells(xlCellTypeBlanks).EntireRow.Delete
End Sub
Rich (BB code):
Sub DeleteEmptyCellsInColumnC()
Dim rng As Range
Dim cell As Range
Set rng = Range("C1:C" & Cells(Rows.Count, "C").End(xlUp).Row)
For Each cell In rng
If cell.Value = "" Or cell.Value = " " Then
cell.Delete Shift:=xlUp
End If
Next cell
End Sub
RapidScribe.xlsm | |||
---|---|---|---|
C | |||
1 | ABC | ||
2 | |||
3 | LMN | ||
4 | |||
5 | XYZ | ||
6 | |||
7 | 123 | ||
8 | QWE | ||
9 | |||
10 | RTY | ||
11 | 456 | ||
12 | UIO | ||
13 | |||
14 | |||
15 | ASD | ||
16 | FGH | ||
Sheet7 |