I'm trying to give my user the option of finding and deleting a row based on thier search criteria. The problem I've run into is it will only delete the specific cell where the search term was located. I would like it to delete the whole range within the row. Here's a copy of my code so far.
Sub findandkill()
Dim x As Variant
Set x = Cells.Find(What:=InputBox("Please enter your search criteria", "Search"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns)
If Not x Is Nothing Then
x.Activate
Else
MsgBox "Not found."
End If
Sheets("Journal Entry").Unprotect "password"
Selection.ClearContents
Sheets("Journal Entry").Protect "password"
End Sub
Any pointers on how I can set the number of cells within the row to clear?
Thanks in advance.
Sub findandkill()
Dim x As Variant
Set x = Cells.Find(What:=InputBox("Please enter your search criteria", "Search"), LookIn:=xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns)
If Not x Is Nothing Then
x.Activate
Else
MsgBox "Not found."
End If
Sheets("Journal Entry").Unprotect "password"
Selection.ClearContents
Sheets("Journal Entry").Protect "password"
End Sub
Any pointers on how I can set the number of cells within the row to clear?
Thanks in advance.