As Fazza mentioned you should use different variable names 'search' may be a reserved term, anyway it is not obvious its a variable.
Here's an example:
Code:
Sub searchstr()
Dim strLookfor as String
Dim strLookin as String
Dim strResult as String
strLookin = Trim(Cells(1, 1))
strLookfor = Trim(Cells(1, 2))
If Instr(1, strLookin, strLookfor) > 0 Then
strResult = "Found in Column A"
Else
strResult = "Not Found"
End If
Cells(1, 3) = strResult
End Sub
You notice i used the 'Cells' method verses Range to identify the cell location. Using the 'Cells' method allows you more versitility in controlling the process flow. Often you need to work on an entire worksheet of data. With Cells you can easily do this using a 'For Next' statement to loop through all the rows.
Code:
For i = 2 to 100
' write something to column A
Cells(i, 1) = "This is Row: " & i
Next