jewkes6000
Board Regular
- Joined
- Mar 25, 2020
- Messages
- 60
- Office Version
- 365
- Platform
- Windows
This one is a doosey, but I thought I'd still give it a try. I am trying to run a macro which takes data from my "Database" tab and imports it into my "Tool" tab by matching the data from columns in each tab. Here is what I need to happen:
Last, to throw a wrench into things, if there are multiple matches on the "Database" tab, I need to add them together. For example, if my project name was "Project 3", and I was on row 249 in the "Tool" tab (Electrical), then it would copy the following numbers into columns C through F (Only bold numbers to copy, just showing the other numbers for clarification). These numbers come from rows 155, 199, 232 & 253 on the "Database" tab.
Here is a link to download the sample file:
I know this one is complicated and hard to follow, but any help is greatly appreciated. I've been stuck on this one for a few days now. Thank you in advance!
- Loop through column B on the "Tool" tab
- For each row it loops through in the "Tool" tab, it needs to check the value in column B, and see if there is a match in column E in the "Database" tab
- At the same time, it needs to check if the project name matches. The project name on the "Tool" tab is located in cell C1. The project name for each line item on the "Database" tab is located in column A.
- If the project name matches the "Database" column A AND the Cost Code Description matches the "Database" column E, then I need to copy the data for that row in the "Database" tab columns F through I into the "Tool" tab under columns C through F.
- Column C = 63,159
- Column D = 86,843
- Column E = 7,895
- Column F = 157,897
Last, to throw a wrench into things, if there are multiple matches on the "Database" tab, I need to add them together. For example, if my project name was "Project 3", and I was on row 249 in the "Tool" tab (Electrical), then it would copy the following numbers into columns C through F (Only bold numbers to copy, just showing the other numbers for clarification). These numbers come from rows 155, 199, 232 & 253 on the "Database" tab.
- Column C = 821,165+37,418+223,677+52,060 = 1,134,320
- Column D = 1,129,102+51,450+307,556+71,582 = 1,559,690
- Column E = 102,646+4,677+27,960+6,507 = 141,790
- Column F = 2,052,912+93,546+559,192+130,149 = 2,835,799
Here is a link to download the sample file:
Loop Through Column & Match Data with Column in Other Worksheet.xlsx
drive.google.com
I know this one is complicated and hard to follow, but any help is greatly appreciated. I've been stuck on this one for a few days now. Thank you in advance!