Thread: Delete Line
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen[_2_] Per Jessen[_2_] is offline
external usenet poster
 
Posts: 703
Default Delete Line

Hi

Use this:

xRange.EntireRow.Delete

Regards,
Per

On 8 Maj, 14:03, Shawn wrote:
I need the code below altered so it deletes the entire row the blank cell is
in.

* * * * * * * * * * Dim xRange As Range
* * * * * * * * * * Dim xCell As Range

* * * * * * * * * * For Each xCell In Sheets("CDPTR").Range("A2:A25")
* * * * * * * * * * * * If xCell.Value = 0 Then
* * * * * * * * * * * * * * If xRange Is Nothing Then
* * * * * * * * * * * * * * * * Set xRange = xCell
* * * * * * * * * * * * * * Else
* * * * * * * * * * * * * * * * Set xRange = Union(xRange, xCell)
* * * * * * * * * * * * * * End If
* * * * * * * * * * * * End If
* * * * * * * * * * Next xCell
* * * * * * * * * * xRange.Delete Shift:=xlup

--
Thanks
Shawn