Macro to Update Data Between 2 Workbooks

Soprano82

New Member
Joined
Feb 8, 2014
Messages
2
Hey guys,

I am having some issues creating a macro to update cell data in a "master" workbook from another workbook that is generated weekly based on a Part ID. The Part ID is located in Column A in both workbooks, and the weights in the workbook to be read are in Column B. Here's a sample to give you an idea of what the "master" sheet looks like:

A B C D,E,F G
(Row 1) Part Number Secondary ID Description (3 other Columns here) Latest Weight
X0054 ..... ..... ..... Column to be updated.
X0055
Column to be Identified.

As a secondary function, I need the macro to copy and paste the previous "Latest Weight" to the next empty column to right of the latest weight column, keeping the data starting in row 2, (so that the previous week's weight data will be in Column H when the macro is run this week, and in a week from now, when the new sheet is made, this week's data will be in Column I, and so on) before the macro updates the "Latest Weight" column with the new data obviously. I have to maintain the old weight data to keep a running average and standard deviation of the weights. Column D will be average, Column E will be standard deviation, and Column F will be delta, that is the difference between the updated weight data and most previous weight data. Finally, I have not been able to wrap my mind around how to automate the delta calculation, as the most previous weight data location will clearly change after the macro has run each time. I believe the average and standard deviation calculations will be fairly straightforward with the count function though. I have looked up this question on many forums, but nothing I have found seems adequate for what I am looking for. I have very little knowledge of VBA, so any assistance would be much appreciated.

Thank you.
 

Excel Facts

VLOOKUP to Left?
Use =VLOOKUP(A2,CHOOSE({1,2},$Z$1:$Z$99,$Y$1:$Y$99),2,False) to lookup Y values to left of Z values.
Sorry to double post, but the formatting I had setup got lost when I posted this. Here's something that is a little more clear.

Hey guys,

I am having some issues creating a macro to update cell data in a "master" workbook from another workbook that is generated weekly based on a Part ID. The Part ID is located in Column A in both workbooks, and the weights in the workbook to be read are in Column B. The "master" spreadsheet is set up as follows: Column A is the Part ID (Column to be Identified), Column B is a secondary ID, Column C is Description, Column D is Average, Column E is Standard Deviation, Column F is Delta, that is the difference between the updated weight data and most previous weight data, and Column G is the Latest Weight Column (Column to be Updated). All data is input starting in the 2nd row running downward under each heading.

As a secondary function, I need the macro to copy and paste the previous "Latest Weight" to the next empty column to right of the latest weight column, keeping the data starting in row 2, (so that the previous week's weight data will be in Column H when the macro is run this week, and in a week from now, when the new sheet is made, this week's data will be in Column I, and so on) before the macro updates the "Latest Weight" column with the new data obviously. I have to maintain the old weight data to keep a running average and standard deviation of the weights. Finally, I have not been able to wrap my mind around how to automate the average, standard deviation, and delta calculation as the the additional column of data is added each time after the macro runs. I have looked up this question on many forums, but nothing I have found seems adequate for what I am looking for. I have very little knowledge of VBA, so any assistance would be much appreciated.

Thank you.
 
Upvote 0

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