Thread: Delete Row
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz JLGWhiz is offline
external usenet poster
 
Posts: 3,986
Default Delete Row

Do you mean that if a name is entered into the InputBox and it matches a name
already entered "somewhere" in Column "A" , that you want to delete the
entire row for the cell location of the name in column "A"?

Sub anyName()
lr = Cells(Rows.Count, 1).End(xlUp).Row
Response = Application.InputBox("Enter a name", "Name to find", , , , , , 2)
For i = 1 To lr
If LCase(Cells(i, 1).Value) = LCase(Response) Then
Cells(i, 1).EntireRow.Delete
End If
Next
End Sub

"Bernie" wrote:

I need to delete an entire row based on a name entered into an input
box that would match a worksheet with that name in column "A".


Thanks,
Bernie