I have a form, SearchForm, that has a text box called TicketNumber. Once the button is clicked, I want the value in the text box to be compared to the Column Range called AllTicketNumbers. When it finds a match, I want the entire row output to a worksheet called Search Results. For this case there's only going to be one row returned because each ticket number can only occur once. But, I want to take this code, change the specific names and be able to use it to search other fields. The following code is what I came up with. No errors are found but no results are output either. Any suggestions on what I should change?
For Each cell In Range("AllTicketNumbers"
If cell.Value = SearchForm.TicketNumber.Value Then
lRow = Worksheets("Search Results".Range("a1".End(xlDown).Row
Worksheets("Search Results".Range("A" & lRow + 1).Value = cell.Value.EntireRow
End If
Next
For Each cell In Range("AllTicketNumbers"
If cell.Value = SearchForm.TicketNumber.Value Then
lRow = Worksheets("Search Results".Range("a1".End(xlDown).Row
Worksheets("Search Results".Range("A" & lRow + 1).Value = cell.Value.EntireRow
End If
Next