LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
I don't want to graph "null" values? jfinney Charts and Charting in Excel 1 June 19th 09 02:23 PM
OTHER options for chart not plotting null ("") or zero values superdanz Charts and Charting in Excel 2 September 2nd 08 10:00 AM
Delete rows containing "ISA" in column A only, starting from row 6 iansmigger Excel Programming 2 July 11th 07 12:24 PM
cells formatted to tick when text value "Y" if or null if "N" Jay Excel Discussion (Misc queries) 7 January 13th 06 09:16 AM
"IF"- "THEN" type Formula based on Null value Jay Excel Worksheet Functions 8 November 17th 05 09:05 AM


All times are GMT +1. The time now is 03:30 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"