Just learning vba and trying to put it together.
If I want to delete a row if a value in its column is blank. So if it was column F and starting from F1.
F1 & F2 are blank and F8 & F9 are blank etc i would want to delete rows 1,2 & 8,9.
This is how I am setting it up but cannot get it to work.
I get a type mismatch saying I can't check if blank cells are true. Why?
If I want to delete a row if a value in its column is blank. So if it was column F and starting from F1.
F1 & F2 are blank and F8 & F9 are blank etc i would want to delete rows 1,2 & 8,9.
This is how I am setting it up but cannot get it to work.
Code:
Sub deleteBlankRows()
Dim Cell As Range
Cells("F1").Select
Range(ActiveCell, ActiveCell.End(xlDown)).Select
For Each Cell In Selection
If Selection.SpecialCells(xlCellTypeBlanks) Is True Then
Selection.EntireRow.Delete
End If
Next Cell
End Sub