Thread: Delete Rows
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.newusers
Gary''s Student Gary''s Student is offline
external usenet poster
 
Posts: 11,058
Default Delete Rows

This macro:

Sub remover()
v = Sheets("Sheet1").Range("A1").Value
For Each r In Sheets("Sheet2").UsedRange
If r.Value = v Then
r.EntireRow.Delete
Exit Sub
End If
Next
End Sub

will get the value in cell A1 of Sheet1. It will then go to Sheet2, locate
the first cell with that value and delete the entire row.
--
Gary's Student


"Bernie" wrote:

I would like to be able to delete a row with a name in it based on a
cell with that name from another cell in a different worksheet. Any
ideas?

Thanks,
Bernie