ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Compare two Workbooks and combine data into one workbook (https://www.excelbanter.com/excel-programming/367042-compare-two-workbooks-combine-data-into-one-workbook.html)

SBonner

Compare two Workbooks and combine data into one workbook
 
Hello,

Each month I have to run a report (REPORT 2) and compare it with
another report (REPORT 1),
do some caluculations and generate a report with the combined data.
The accounts on each report are not necessarily the same, but they
all need to be on the final report, sorted by account.

I have seen some examples of how I might be able to do this,
but I don't know VBA well enough to make it work. Any help
would be greatly appreciated.

The Titles/Headings from REPORT 2 will be used.
The account descriptions which need to be matched start in cell A14.

REPORT 1 contains data for the first half of 2006(data will not
change).
REPORT 2 will be run each month end for the rest of this year.

If the acct desc is the same on both reports(matches):
From Report2 I need values in Columns B, C and D.
From Report1 and Report2 I need the following

Column E (Report1 Column E +Report2 ColumnE)
Column F (Report1 Column F +Report2 ColumnF)
Column G (Report1 Column G +Report2 ColumnG)

If the acct desc is only in REPORT 1:
Columns B, C and D must be set to zero, and Columns E, F and G
values remain the same.

If the acct desc is only in REPORT 2:
Need the row of data, but no changes required to any values

Then I need to calculate totals for Columns B through G.

ColA ColB ColC ColD ColE ColF ColG

PTD PTD PTD YTD YTD YTD
Act Bud Var Act Bud Var

Total Costs
acct desc 2 PAmt 2 PBAmt2 PVAmt2 YAmt2 YBAmt2 YVAmt2
acct desc 3 PAmt 3 PBAmt3 PVAmt3 YAmt3 YBAmt3 YVAmt3
acct desc 4 PAmt 4 PBAmt4 PVAmt4 YAmt4 YBAmt4 YVAmt4
acct desc 5 PAmt 5 PBAmt5 PVAmt5 YAmt5 YBAmt5 YVAmt5
acct desc 14 PAmt 12 PBAmt12 PVAmt12 YAmt12 YBAmt12 YVAmt12

Total PTotal PBTotal PVTotal YTotal YBTotal YVTotal

Thanks



All times are GMT +1. The time now is 12:52 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com