Hi all,
I have a problem where I have the below code deletes the upper most empty row if no name or an incorrect name is entered into the InputBox?
I thought I may overcome this with If searchthis = "" Then Exit Sub but it doesn't seem to work. Help would be appreciated.
Thanks.
Sub Button4_Click()
'Archive person X Dock
Dim searchthis
searchthis = InputBox("Enter employee NAME to search.", "Property Search")
If searchthis = "" Then
Exit Sub
End If
On Error GoTo errorhandler
Application.ScreenUpdating = False
ActiveSheet.Range("b:b").Select
Selection.Find(What:=searchthis, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext).Activate
ActiveCell.Select
Rows(ActiveCell.Row).Delete Shift:=xlUp
Application.ScreenUpdating = True
Exit Sub
I have a problem where I have the below code deletes the upper most empty row if no name or an incorrect name is entered into the InputBox?
I thought I may overcome this with If searchthis = "" Then Exit Sub but it doesn't seem to work. Help would be appreciated.
Thanks.
Sub Button4_Click()
'Archive person X Dock
Dim searchthis
searchthis = InputBox("Enter employee NAME to search.", "Property Search")
If searchthis = "" Then
Exit Sub
End If
On Error GoTo errorhandler
Application.ScreenUpdating = False
ActiveSheet.Range("b:b").Select
Selection.Find(What:=searchthis, After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext).Activate
ActiveCell.Select
Rows(ActiveCell.Row).Delete Shift:=xlUp
Application.ScreenUpdating = True
Exit Sub