Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
delete rows with null values in "M" column
I'm trying to delete the rows where the cell "M" has a null or blank value.
I borrowed this script and it compiles. The question I have is what is the test if range to delete Is NOthing then.... mean. Does that stand for null?? Also what is the union of the rng to delete? Do I just do if IsNull(rng) set rng to delete = rng I realize they are trying to be careful but I don't quite understand what is going on. thanks ---------------code--------------------------- Sub deleteRows() Dim Rng As Range Dim rngToSearch As Range Dim rngToDelete As Range With ActiveSheet Set rngToSearch = .Range(.Range("M1"), .Cells(Rows.Count, "M").End(xlUp)) End With For Each Rng In rngToSearch If IsNull(Rng) Then If rngToDelete Is Nothing Then Set rngToDelete = Rng Else Set rngToDelete = Union(rngToDelete, Rng) End If End If Next Rng If Not rngToDelete Is Nothing Then rngToDelete.EntireRow.Delete |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
I don't want to graph "null" values? | Charts and Charting in Excel | |||
OTHER options for chart not plotting null ("") or zero values | Charts and Charting in Excel | |||
Delete rows containing "ISA" in column A only, starting from row 6 | Excel Programming | |||
cells formatted to tick when text value "Y" if or null if "N" | Excel Discussion (Misc queries) | |||
"IF"- "THEN" type Formula based on Null value | Excel Worksheet Functions |