VBA Macro to Move and Update Data from one Workbook to Another

Theken67

New Member
Joined
Dec 6, 2021
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I am trying to see if there is a macro that I can use in a Master file that will check a Template file, and based on a letter in Column I, will move certain data to the Master file and update it. Each letter in Column I will have it's own argument. For example:

  • If the letter in Column I of the Template file = A, Match the account number in Column A of the Template file to Column A of the Master file, and ADD the data from Column B, or Column C, or Column D, or Column E, or Column F, or Column G, or Column H of the Template file to the existing record in the same column of the Master file.
  • If the letter in Column I of the Template file = C, Match the account number in Column A of the Template file to Column A of the Master file, and CHANGE the data from Column B, or Column C, or Column D, or Column E, or Column F, or Column G, or Column H of the Template file to the existing record in the same column of the Master file.
  • If the letter in Column I of the Template file = D, Match the account number in Column A of the Template file to Column A of the Master file, and DELETE the data from Column B, or Column C, or Column D, or Column E, or Column F, or Column G, or Column H of the Template file from the existing record in the same column of the Master file.
Basically, I want to be able to have people enter additions, changes, and deletions into the Template file, and when I run the VBA macro in the Master file, it enacts those changes automatically without having to manually key each update. The columns in each workbook are exactly the same as far as number of columns and headers. The Master file with contain approx. 5,000 records that only occur once, no duplicates, but the Template file may have duplicates based on how many time something is altered, however that could be worked around if needed to avoid errors.
Thanks!
Template Example.png
 

Excel Facts

Save Often
If you start asking yourself if now is a good time to save your Excel workbook, the answer is Yes

Forum statistics

Threads
1,223,236
Messages
6,170,915
Members
452,366
Latest member
TePunaBloke

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