Mamarazzi
asked on
Copying data using key column and excluding #N/A
I want to copy data from one workbook to another using a key column that exist in both.
So far I've tried using VLOOKUP but I'm not sure it is the best way.
I have a button that runs a macro. First I select the cells I want the formula in:
Sub Copy_Formula()
Selection.ClearContents
Selection.FormulaR1C1 = _
"=VLOOKUP(RC[-7],[Book2.xl s]Sheet1!R 5C3:R181C4 ,2,FALSE)"
End Sub
This works fine, BUT... I want the values in the cells, not the formula itself. And I want to clear the #N/A that I get in the cells if the formula has no match.
Any idea?
So far I've tried using VLOOKUP but I'm not sure it is the best way.
I have a button that runs a macro. First I select the cells I want the formula in:
Sub Copy_Formula()
Selection.ClearContents
Selection.FormulaR1C1 = _
"=VLOOKUP(RC[-7],[Book2.xl
End Sub
This works fine, BUT... I want the values in the cells, not the formula itself. And I want to clear the #N/A that I get in the cells if the formula has no match.
Any idea?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER