Hi,
I am writing some (fairly basic) code where a user inputs a number to an input box which is then copied to a cell but I am trying to add a little extra functionality whereby if the value input results in an error i.e. the details related to that number are 'not found' (by a vlookup with an if in a different cell) then an message box is displayed with "Not Found". I've had a bash with little success but I think it's mainly because I don't know where to place the lines in my code.
Hope you can help.
Thanks
![]()
Sub New_Search() Dim strSearch As String strSearch = InputBox("Enter Agreement No.", "New Search") If strSearch <> "" Then Sheets("Sold Lookup").Range("E5").Value = strSearch If strSearch = "" Then Sheets("Sold Lookup").Range("E5").Value = "" End Sub
Bookmarks