How to extract data using VBA in Excel? [Closed]

 Blocked Profile -

Need some help to create a VBA for Excel 2016..

Basically i have 2 workbooks.

Workbook 1 is Master File.
Workbook 2 is the monthly data that's extracted from system..

I need to extract a value from Workbook 2 into Workbook 1 with vlookup function. Vlookup will be comparing the "Name" in workbook 1 (Column C) to workbook 2 (Column G). Once the "Name" matches, will need the sub-category of "Type" in workbook 1 (Column D) to workbook 2 (Column H) to match too. Once both column field matches, I need to extract "Amount" in workbook 2 (Column M) to workbook 1 (last column of the workbook - Column J).

Will be good if the coding can highlight the differences in "Amount" too. In Workbook 1, "Amount" is in Column E.

Anyone can help what is the correct code to use?

1 reply

Vlookup require your INDEX to be in the most left position, so if your index is not in the most left, this won't work. Per the MS how to @

"Remember that the lookup value should always be in the first column in the range for VLOOKUP to work correctly."

Post back if it is !

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!