lundi 14 juin 2021

VBA for capturing data from excel to excel file with VLOOK UP and IF functions

Lets say I have data an excel file A in tab "Data A" and range cells a1:d6 which is periodically updated by other teams and want my excel file B to capture it in tab "Data B" and range cells e1:h6. In that case I would use a VLOOKUP to transfer info.

The problem is I want to have control over when info from file A is transferred to file B since some data in file A is not always correct and needs to be confirmed before being transferred. In this circumstance VLOOKUP will be automatically capturing in file B all the updated info from file A; also, existing info in file B will be replaced and former data lost, as soon as file A is updated. Note Excel manual update is not an option.

I thought the best option would be to combine in a macro a VLOOKUP and IF. This way I would be triggering the VLOOKUP function whenever a simple condition is achieved, e.g. a "Yes" in a column of file B tab "Data B" and range cells i1:i6.

Does it make sense? If so, could you help me with the coding? If you know of a quickest way to do so, please let me know

Many thanks in advance

Aucun commentaire:

Enregistrer un commentaire