View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Andoni[_24_] Andoni[_24_] is offline
external usenet poster
 
Posts: 1
Default delete row programmatically

Sub TryThis()
Dim X As Long
Dim Y As Long
Y = Range("A65536").End(xlUp).Row
'y= find the last non empty cell in column A
For X = Y To 1 Step -1
'Lcase gets the lower case of the word
If lcase(Cells(X, 1).Value) = "delete" Then
Rows(X).Delete
End If
Next

--
Message posted from http://www.ExcelForum.com