Thread: Delete Rows
View Single Post
  #4   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

Just enter the new name in the same cell and run the macro again.
--
Gary's Student


"Bernie" wrote:

That worked great, thank you so much.

How do I run the same macro for another name right after this one?

Bernie


Gary''s Student wrote:
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