FatalLordes
Board Regular
- Joined
- Dec 22, 2017
- Messages
- 76
- Office Version
- 365
- Platform
- Windows
Hey all
Ok, I'm new to Excel and VBA so I'm having trouble even working out how to go about this. I have two workbooks, BookA and BookB. Both have a column which would match (Col1). What I need BookA to do is, for each row of data, look at the column that would have the matching data (Col1) and find the matching data in BookB (which also happens to be in Col1). It then needs to copy the content of Col5 for that row in Book B and paste it into the corresponding row in BookA but in Col4. Make sense?
For example, BookA looks like the following:
BookB looks like the following:
So in BookA it would look in the Ref column and find the first row data ("1") and then go look up BookB to find the matching Ref, then copy Col 5 from BookB for that row and paste it into Col 4 for that row in BookA. So "Bananas" would update to become "Bananas in all their glory" once the script has run. Does that make sense? And it needs to do that for every row in BookA. If possible, if it doesn't find a match in BookB (very rare but I guess not impossible), I would like to shade the Ref Cel in BookA so it is obvious something was wrong, or something like that, but that is a nice to have... the main thing is getting that data from BookB to BookA.
Hope that makes sense And hope someone can point me in the right direction as to how to even go about this. Truly appreciate all your help :D
Ok, I'm new to Excel and VBA so I'm having trouble even working out how to go about this. I have two workbooks, BookA and BookB. Both have a column which would match (Col1). What I need BookA to do is, for each row of data, look at the column that would have the matching data (Col1) and find the matching data in BookB (which also happens to be in Col1). It then needs to copy the content of Col5 for that row in Book B and paste it into the corresponding row in BookA but in Col4. Make sense?
For example, BookA looks like the following:
Ref | Title | Date | Topic | Size | Colour |
1 | Big Banana | 09/02/2021 | Bananas | Big | Yellow |
2 | Little Apple | 09/02/2021 | Apples | Little | Red |
BookB looks like the following:
Ref | Title | Date | Version | Topic | Size | Colour | Shape | Author |
1 | Big Banana | 09/02/2021 | 5 | Bananas in all their glory | Big | Yellow | Circle | BW |
2 | Little Apple | 09/02/2021 | 2 | Apples | Little | Red | Square | AB |
So in BookA it would look in the Ref column and find the first row data ("1") and then go look up BookB to find the matching Ref, then copy Col 5 from BookB for that row and paste it into Col 4 for that row in BookA. So "Bananas" would update to become "Bananas in all their glory" once the script has run. Does that make sense? And it needs to do that for every row in BookA. If possible, if it doesn't find a match in BookB (very rare but I guess not impossible), I would like to shade the Ref Cel in BookA so it is obvious something was wrong, or something like that, but that is a nice to have... the main thing is getting that data from BookB to BookA.
Hope that makes sense And hope someone can point me in the right direction as to how to even go about this. Truly appreciate all your help :D