View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default Deleting rows with VBA

Hi Greg

I have examples on this page
http://www.rondebruin.nl/delete.htm

If you need more help post back
Check out the Autofilter example first (fast)

--
Regards Ron de Bruin
http://www.rondebruin.nl


"Greg http://gregmaxey.mvps.org/word_tips.htm" wrote in message
oups.com...
Hello,

I dabble in Word VBA but today I am challenged with an Excel
spreadsheet and find myself hopelessly lost.

Until corrected I will refer to the spreadsheet grid as rows and
columns. I have many rows and many columns. The value in column "P"
is either 1 or 0. I want to delete any row that has a "P" column value
of 0.

This is my attempt at logical thought but it doesn't work. Please
help.

Sub DeleteRows()

For Each oRow in ActiveSheet.Rows
If ActiveSheet.Columns("P").value = 0 Then
oRow.Delete
End If
Next oRow

End Sub