Copy data from one file to another if specific cell match between the files

Panoos64

Well-known Member
Joined
Mar 1, 2014
Messages
890
Hi to all of you,
I would like to create a VBA code so that to run through col. “B” file D:\users\Items\DriveD\[Items.xlsx]Sheet1 and where the number match with cell “C4” in file C:\Users\Stock\Desktop\[Invetory.xlsx]Sheet1 should pull (copy) the texts from column “H” and place them in col. “N” in file D:\users\Items\DriveD\[Items.xlsx]Sheet1. Therefore, that the copy should be in a horizontal, by transpose option. Please see below an extract of original data in schedule “1” and the expected result in schedule “2”.Thank you all in advance

Schedule 1
C:\Users\Stock\Desktop\[Invetory.xlsx]Sheet1

1669201469886.png


D:\users\Items\DriveD\[Items.xlsx]Sheet1

1669201502665.png


Schedule 2

D:\users\Items\DriveD\[Items.xlsx]Sheet1

1669201531872.png



1669201571718.png
 

Excel Facts

What is the fastest way to copy a formula?
If A2:A50000 contain data. Enter a formula in B2. Select B2. Double-click the Fill Handle and Excel will shoot the formula down to B50000.
Hi once again! Describing my issue i express it wrong. Just simply require how to pull the data from file C:\Users\Stock\Desktop\[Invetory.xlsx]Sheet1!', col. "H" in to col. "N" but in horizontal style, by transpose option. Apologies for my wrong message. The expected result is below. Thank you all in advance!

1669296420520.png
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top