ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Delete Row (https://www.excelbanter.com/excel-programming/381908-delete-row.html)

Bernie

Delete Row
 
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


JLGWhiz

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




All times are GMT +1. The time now is 02:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com