Copying queried cell information from one workbook to another

Let's say that I have two workbooks: FileX and FileY. (both .csv files) I am looking to create a Macro that copies from a certain cell in File X to a certain cell in File Y. This would be done based off a query.

Example:
The query compares all values listed in Column A of FileX to all values listed in Column A of FileY. If the value matches in column A in both files (let’s say: IF ID = 5), it then retrieves information from Column J of FileX for that row and pastes it in the corresponding row of FileY Column J.

Is this possible? And if so, how could one do this?

Hi, I don't think it is

Hi,

I don't think it is necessary to use VBA Macro to do this except if you really want to.

If you use the VLookup function, you will be able to get the value of a particular column according to a matched value between to tables.

The best way to do this is to copy each worksheet into a single file.

Do you really want a VBA subroutine anyway ?