Thread: Delete a row
View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
monika monika is offline
external usenet poster
 
Posts: 28
Default Delete a row

Rows(i) worked quite well....

thanks
"Damian Lee" wrote in message
...
Try this

Sub monika()
Dim i As Integer
Dim Lastcellnum
i = 1
Lastcellnum = 14
While i < Lastcellnum
If Cells(i, 1) = "" Then
Rows(i).Select
Selection.Delete Shift:=xlUp
Lastcellnum = Lastcellnum - 1
End If
i = i + 1
Wend
End Sub


-----Original Message-----
I am checking if a particular cell is empty then I can
delete the entire
row..

This particular code is not working:
While Cells(i, 3) = ""
Rows("i:i").Select
Selection.Delete Shift:=xlUp
lastCellNum = lastCellNum - 1
i = i + 1
Wend

Thanks
monika

.