Starstopper31
New Member
- Joined
- Jan 19, 2015
- Messages
- 8
Hello,
I am fairly new to VBA and have tried searching for an example of this with limited luck so far. I'm not sure if my question is too specific or I'm wording it wrong. I am trying to copy and paste data from one workbook to another using VBA. In workbook #1, I have data in both columns "A" and "B". In workbook #2, I have the same values in column "A" (in a different order), and column "B" is blank.
I am trying to find a way to copy the data in the "B" column from Workbook #1 and paste it into the empty "B" column in Workbook #2. The trick is getting the data to show up in the correct row in Workbook #2 so that the values in column "A" still match with "B" in Workbook #2. Both ranges are dynamic, so I can't just paste from one designated cell to another because the rows change.
Please see example below:
Workbook #1
Workbook #2 - (How it looks when the workbook opens)
Workbook #2 - (What I am wanting the code to do)
My actual file is more complicated than this, but I feel like I can figure the rest out if I can find an example to use as a baseline. Any help would be appreciated. Thanks.
I am fairly new to VBA and have tried searching for an example of this with limited luck so far. I'm not sure if my question is too specific or I'm wording it wrong. I am trying to copy and paste data from one workbook to another using VBA. In workbook #1, I have data in both columns "A" and "B". In workbook #2, I have the same values in column "A" (in a different order), and column "B" is blank.
I am trying to find a way to copy the data in the "B" column from Workbook #1 and paste it into the empty "B" column in Workbook #2. The trick is getting the data to show up in the correct row in Workbook #2 so that the values in column "A" still match with "B" in Workbook #2. Both ranges are dynamic, so I can't just paste from one designated cell to another because the rows change.
Please see example below:
Workbook #1
Workbook #2 - (How it looks when the workbook opens)
Workbook #2 - (What I am wanting the code to do)
My actual file is more complicated than this, but I feel like I can figure the rest out if I can find an example to use as a baseline. Any help would be appreciated. Thanks.