Hello fellow experts,
where is the mistake in this code? It says "Else without If" although there is If. Any ideas?
Private Sub TextBox1_Change()
Dim Searched As String
Dim Found As Range
Dim SearchRange As Range
Set SearchRange = ActiveSheet.Range(("E14"), Range("E14").End(xlDown))
Searched = TextBox1.Value
If Searched = "" Then Exit Sub
Set Found = SearchRange.Find(Searched)
If Found Is Nothing Then MsgBox ("Name could not be found in the namelist")
ActiveWindow.ScrollRow = Range("A14").Row
Else: Found.Select
End If
ActiveWindow.ScrollRow = ActiveCell.Row
TextBox1.Activate
End Sub
Bookmarks