Pull data from workbook_A to create workbook_B and modify data

mkseto

New Member
Joined
Aug 14, 2018
Messages
38
New to VBA, hope someone can help to create a macro for the following task:

On a regular basis, I get a workbook_A that has the following layout:
Workbook_A.gif


I need to open a new workbook_B that would look like the following, then close workbook_A without saving, and name workbook_B as "Results Workbook":
Workbook_B.gif


In other words, for workbook_B:
- Create a header row with the various labels (ideally, bold the font and grey the cells)
- Column A would just be a count of data rows
- Column B would be the joint values of columns A/B/C from workbook_A (i.e. A&B&C)
- Column C would be values from column E of workbook_A
- Column D would be values from column D of workbook_A
- At the end (last row), insert text "Grand Total" in Column A and sum up the total of Column D per figure above

Hope someone can help, thanks.
 
Just ran into a little problem ........ the codes above has been working well until today. I fugured out the cause but don't know how to fix it.
For as long as at least one of the input files contains a value in the last column "F", the macro works perfectly. However, today is the first time none of the files contained any value in column "F', and the macro returned a runtime error (out of range).
Any easy fix to accommodate such a scenario?
Unfortunately, no easy fix for this. It might be time to start a new thread (this one started in January).
 
Upvote 0

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.

Forum statistics

Threads
1,214,782
Messages
6,121,532
Members
449,037
Latest member
tmmotairi

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