View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
johncassell[_59_] johncassell[_59_] is offline
external usenet poster
 
Posts: 1
Default How to delete these rows ?


Hello, I can help you if what you need is:

if cell doesn't equal 'abc' then delete what is in the cell.

It would then require you to sort afterwards so that you don't have
loads of empty rows.

the code is

Sub subname()
Dim cell As Range
For Each cell In Range("A:A")
If cell.Value < "abc" Then
cell.Value = ""
Else
End If
Next
End Sub

---
if you want to delete the contents of the entire row then replace
cell.value = "" with 'cell.EntireRow.ClearContents'

Hope this helps

Thanks

John


--
johncassell
------------------------------------------------------------------------
johncassell's Profile: http://www.excelforum.com/member.php...o&userid=25016
View this thread: http://www.excelforum.com/showthread...hreadid=565629