Hello all
I need an excel guru to solve this one please
I have multiple lookup's against a primary key in two work tabs
This then brings through the data I need
The problem I have is if the source line no longer exist the lookup will wipe out the last data that was in the cell..
I need something like if the primary key is not there stop the vlookup and leave the content in the cell, if the primary key exists then complete the lookup and over write the cell with the new data.
I need an excel guru to solve this one please
I have multiple lookup's against a primary key in two work tabs
This then brings through the data I need
The problem I have is if the source line no longer exist the lookup will wipe out the last data that was in the cell..
I need something like if the primary key is not there stop the vlookup and leave the content in the cell, if the primary key exists then complete the lookup and over write the cell with the new data.
Code:
With Range("F1:F" & LastRow)
.FormulaR1C1 = "=VLOOKUP(RC[-5],Data!C[-5]:C[15],21,FALSE)"
.Value = .Value
.Replace "#N/A", "", xlWhole
End With