What is wrong here? When a number is found check if near cells are empty. Else time and date in this cells.
LR = Cells(Rows.Count, "B").End(xlUp).Row
st = TextBox1.Value
If st = "" Then
MsgBox "textbox is empty"
Exit Sub
End If
For j = LR To 1 Step -1
code = Range("B" & j).Text
If code = st Then
Range("B" & j).Select
If ActiveCell.Offset(, 4).Value <> vbNullString Then
ActiveCell.Offset(, 4) = Format(Now, "dd/mm/yyyy ")
If ActiveCell.Offset(, 5).Value <> vbNullString Then
ActiveCell.Offset(, 5) = Format(Now, "HH:MM")
Exit For
End If
End If
End If
Next