Might try something along these lines (untested)
Dim strPic_ID As String
strPic_ID = Application.InputBox("Please enter the picture serial number")
Range("C3").FormulaR1C1 = ""
Range("C5").FormulaR1C1 = "=IF(ISBLANK(R3C3)=FALSE,IF((VLOOKUP(R3C3,R9C4:R65535C19,16,FALSE)=0),""System name not found"",(VLOOKUP(R3C3,R9C4:R65535C19,16,FALSE))),strPic_ID)"
Where the user is prompted to enter the picture serial number and strPic_Id replaces the last argument in your formula (84DD12A).
Note: you don't to select cell to act on them. As you in the revised code you simply reference the range then perform whatever action you need.
BTW - if you don't actually have 65,535 rows of data to look through, why make Excel look in every row? You are also forcing Excel to perform the look up twice which is very inefficient.
It is much more efficient to do the look up once and let the look up return #N/A and use a formula like IF (ISNA(A1),"System name not found", A1)
Bookmarks