VBA - Match two values from Table1 to two in Table2 and move/align

Welshy1491

New Member
Joined
Nov 21, 2024
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hi there, first time post here so i apologize in advance.

I have looked everywhere for VBA code to help me with this task but can't seem to find what i need.

I have a large table of engineers stock count which i add to once a month when we run our stock reports, the table grows by two columns every month and usually by a number of rows depending on stock intake. Columns A, B & C are Engineers Name, Part No. and Description. The values i add to the table every month are two columns wide which consists of Value and Quantity, so D,E are first months Value and Quantity, F,G are second months Value and Quantity and so on.

My process at the minute is to paste 5 columns of data (Engineers Name, Part No., Description, Value and Quantity) from this months stock report in to the next available columns of my worksheet. I then manually align the 5 columns of copied in data by matching the Engineers Name and Part No. to columns A and B of my original table. If an engineer has added parts to his stock not listed in the table i must create a new line and add the new Part No. in to my table and if he has used stock and no longer has it on the report i have to add zero's in. This can be very time consuming (having to do it for 15 engineers at the moments) and mistakes can be made when manually moving the rows of data to line up with the original data.

I am looking for VBA code which will allow me to automate this if possible? I have added a few pictures hopefully explain the issue clearer. "Initial Tables 1 & 2" show the two tables i begin with, "Intermediate1 & 2" shows the steps i take to align the data and "Final1 & 2" shows my eventual layout of the table.

Any help at all would be greatly appreciated
 

Attachments

  • Initial Tables 1.PNG
    Initial Tables 1.PNG
    65.6 KB · Views: 0
  • Initial Tables 2.PNG
    Initial Tables 2.PNG
    44.7 KB · Views: 0
  • Intermediate1.PNG
    Intermediate1.PNG
    62.1 KB · Views: 0
  • Intermediate2.PNG
    Intermediate2.PNG
    46.3 KB · Views: 0
  • Final1.PNG
    Final1.PNG
    48.9 KB · Views: 0
  • Final2.PNG
    Final2.PNG
    36.2 KB · Views: 0

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,223,879
Messages
6,175,142
Members
452,615
Latest member
bogeys2birdies

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