Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro to hide rows not working | Excel Discussion (Misc queries) | |||
Trying to delete rows and it's not working | Excel Programming | |||
Delete Rows based on criteria in Column A (not working) | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming |