G
Guest
I have a program that uses vlookup to find values that are stored in a quote.
Some of the older quotes do no contain all of the fields “Lookup_Valuesâ€
that are in the newer quotes. When the program connot find a fileld
“Lookup_Value", excel stops my macro stops and highlightsts the vlookup
function that I am using. Is there a way to use if(iserror(vlookup))then...
or any other functions to work around this problem? I would like the vlookup
function to return "" to the active cell if the field "Lookup value" does not
exist.
Dim SerialRange As Range 'The range of the serial field, from the quote
Set SerialRange = Worksheets("Sheet1").Range("A:C")
Serial = (Application.WorksheetFunction.Vlookup("SER #:", SerialRange,
3, False))
ActiveCell.Formula = Serial
Some of the older quotes do no contain all of the fields “Lookup_Valuesâ€
that are in the newer quotes. When the program connot find a fileld
“Lookup_Value", excel stops my macro stops and highlightsts the vlookup
function that I am using. Is there a way to use if(iserror(vlookup))then...
or any other functions to work around this problem? I would like the vlookup
function to return "" to the active cell if the field "Lookup value" does not
exist.
Dim SerialRange As Range 'The range of the serial field, from the quote
Set SerialRange = Worksheets("Sheet1").Range("A:C")
Serial = (Application.WorksheetFunction.Vlookup("SER #:", SerialRange,
3, False))
ActiveCell.Formula = Serial