Search and Delete

S

scottnshelly

I want to put a button called "Delete" on my userform. when pushed,
was it to find textbox3.value and find it on Sheet("All") and delet
everything on the row.

also, i have another similar question that i will post in a new thread
 
C

Charles

Scott,

Here are two options I came up with. One deletes the entire row and th
other deletes the contents.


Private Sub CommandButton1_Click()
Application.ScreenUpdating = False
Worksheets("All").Activate
With UserForm1
Cells.Find(What:=TextBox3.Value, LookAt:=xlWhole).EntireRow.Delete
End With
End Sub

Private Sub CommandButton2_Click()
Application.ScreenUpdating = False
Worksheets("All").Activate
With UserForm1
Cells.Find(What:=TextBox3.Value, LookAt:=xlWhole).Select
Range("a" & ActiveCell.Row
Selection.End(xlToRight)).ClearContents
End With
End Sub


HTH


Charle
 
Top