G
Greg Snidow
Greetings all. I have a macro that, among other things, deletes all rows
from a sheet where ever a cell in one column is blank. The part of the macro
in question is below.
' Delete rows with no job number
Dim rng As Range
On Error Resume Next
Set rng = Columns(4).SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng Is Nothing Then
rng.EntireRow.Delete
End If
The problem is that recently it does not work for some rows on a report from
a particular user. The cells in column 4 appear to be blank, but when I run
the macro, they are not deleted. If I first highlight all the cells that
appear to be blank, and hit delete, then run the macro, it works fine, so
there seems to be some zero length strings, or just blank spaces in some of
the cells. My question is, how can I include these cells in the set to be
deleted? Thank you.
Greg Snidow
from a sheet where ever a cell in one column is blank. The part of the macro
in question is below.
' Delete rows with no job number
Dim rng As Range
On Error Resume Next
Set rng = Columns(4).SpecialCells(xlBlanks)
On Error GoTo 0
If Not rng Is Nothing Then
rng.EntireRow.Delete
End If
The problem is that recently it does not work for some rows on a report from
a particular user. The cells in column 4 appear to be blank, but when I run
the macro, they are not deleted. If I first highlight all the cells that
appear to be blank, and hit delete, then run the macro, it works fine, so
there seems to be some zero length strings, or just blank spaces in some of
the cells. My question is, how can I include these cells in the set to be
deleted? Thank you.
Greg Snidow