VBA to Vlookup from pivot tables diffrent files

aaleem

Board Regular
Joined
Sep 26, 2014
Messages
56
Office Version
  1. 2016
Hi,

i have two files (1. the current file and 2. Last week's file) where Pivot tables are there on multiple sheets. I m trying to bring the last week's data into the current file. The issue I'm facing is the same status is available in the Comb. Status column.

is there a possibility to bring the last week's data by combining two columns (Col A and Col B) from the pivot tables for each of the statuses on all the sheets in the current file thru VBA .

I'm attaching a sample Data, there will be two separate files and the name will get updated each week.

Any help will be appreciated.

Book2
ABCDEFG
1ValuesLast Week
2RemarksComb.StatusCount of GRN Number Sum of Converted AED GRN No. AED
3Not Yet DueAwaiting Appointment12377,99345618,151Vlookup (ColA &ColB, from last week file, Count of GRN Number)
4Awaiting Manual Match5801,638,98112903,055,123
5Awaiting REIM Posting501,042,84222.5388,531The Table Array is not fixed, this will be +/- rows in the last week file
6Awaiting Shipment Recipt Warehouse31395,082187.52,086,640
7Awaiting System Match18372,96947.51,340,514
8Awaitng FSS submission warehouse3143,291,477537.54,158,195
9Failed to Post REIM244,8057.581,719
10Pending Liability Creation83672,599977.54,179,833
11Pending with Planner6708,705,728171515,095,803
12Pending with Supply Chain18387,99440677,422
13Awaiting EDI File Creation14361,17010234,169
14Pending with Warehouse-GRN showing in Microstrategy/No Handles4544,745,311447.51,283,872
15Pending with Warehouse-GAC45198,07155125,119
16Pending with Stores- Drag and drop not done/Handle not created1562,828,927252.52,644,851
17Manual Match-DOC in folder/Handle not created12111,81537.5203,455
18Pending QA-DSD3092,056,889151512,441,923
19Pending with Warehouse-GRN showing in Microstrategy/Handle created6105,84225216,871
20Not Yet Due Total2,77427,338,4957,21348,832,191
21Over DueAwaiting Manual Match64253,723198360,711
22Awaiting REIM Posting861,27623108,147
23Awaiting Shipment Recipt Warehouse193931,601
24Awaitng FSS submission warehouse39261,64185707,916
25Failed to Post REIM1041,67333,215
26Pending Liability Creation971,063,4454132,562,483
27Pending with Planner4606,124,6881,15511,125,584
28Awaiting EDI File Creation121,22256,088
29Pending with Warehouse-GRN showing in Microstrategy/No Handles19192,01263344,632
30Pending with Stores- Drag and drop not done/Handle not created211,0431843,420
31Pending with Warehouse-GRN showing in Microstrategy/Handle created33252,44978393,555
32Over Due Total7348,284,1112,04015,657,352
33(blank)Awaiting Manual Match764,797
34Awaitng FSS submission warehouse252,680
35Pending QA-DSD250,574
36Pending with Warehouse-GRN showing in Microstrategy/Handle created1309
37(blank) Total12168,360
38Due in 7 DaysAwaiting Manual Match4099,878
39Awaitng FSS submission warehouse11144,607
40Failed to Post REIM129,432
41Pending Liability Creation77,576
42Pending with Planner93888,529
43Pending with Warehouse-GRN showing in Microstrategy/No Handles2482
44Pending with Stores- Drag and drop not done/Handle not created1614
45Pending with Warehouse-GRN showing in Microstrategy/Handle created795,457
46Due in 7 Days Total1621,266,576
47Grand Total3,68237,057,542
48
Current File
Cell Formulas
RangeFormula
E3:E19E3=VLOOKUP(B3,'Last Week file'!$B$5:$D$21,2,0)
F3:F19F3=VLOOKUP(B3,'Last Week file'!$B$5:$D$21,3,0)
E20:F20E20=SUM(E3:E19)
E21:E31E21=VLOOKUP(B21,'Last Week file'!$B$23:$D$36,2,0)
F21:F31F21=VLOOKUP(B21,'Last Week file'!$B$23:$D$36,3,0)
E32:F32E32=SUM(E21:E31)



Last week file

Book2
ABCDE
1
2
3Values
4RemarksComb.StatusCount of GRN NumberSum of Converted AED
5Not Yet DueAwaiting Appointment45618,150.61
6Awaiting Manual Match12903,055,123.34
7Awaiting REIM Posting22.5388,530.69
8Awaiting Shipment Recipt Warehouse187.52,086,640.10
9Awaiting System Match47.51,340,513.52
10Awaitng FSS submission warehouse537.54,158,195.12
11Failed to Post REIM7.581,718.79
12Pending Liability Creation977.54,179,833.46
13Pending with Planner171515,095,803.41
14Pending with Supply Chain40677,422.46
15Awaiting EDI File Creation10234,168.78
16Pending with Warehouse-GRN showing in Microstrategy/No Handles447.51,283,872.19
17Pending with Warehouse-GAC55125,118.95
18Pending with Stores- Drag and drop not done/Handle not created252.52,644,850.83
19Manual Match-DOC in folder/Handle not created37.5203,454.74
20Pending QA-DSD151512,441,922.66
21Pending with Warehouse-GRN showing in Microstrategy/Handle created25216,871.17
22Not Yet Due Total7212.548,832,190.83
23Over DueAwaiting Appointment2.541,988.51
24Awaiting Manual Match197.5360,711.26
25Awaiting REIM Posting22.5108,147.40
26Awaiting Shipment Recipt Warehouse2.51,600.91
27Awaiting System Match10220,752.09
28Awaitng FSS submission warehouse85707,915.77
29Failed to Post REIM2.53,215.23
30Pending Liability Creation412.52,562,482.66
31Pending with Planner115511,125,583.83
32Pending with Supply Chain22.593,956.38
33Awaiting EDI File Creation56,087.78
34Pending with Warehouse-GRN showing in Microstrategy/No Handles62.5344,631.75
35Pending with Stores- Drag and drop not done/Handle not created17.543,420.38
36Pending with Warehouse-GRN showing in Microstrategy/Handle created77.5393,554.85
37Over Due Total207516,014,048.80
38(blank)Awaiting Manual Match1021,708.21
39Awaiting Shipment Recipt Warehouse2.582,785.70
40Pending Liability Creation5156,998.16
41Pending with Planner2.539,753.19
42Pending with Supply Chain2.57,056.53
43Awaiting EDI File Creation2.5795.54
44Pending with Warehouse-GRN showing in Microstrategy/Handle created2.5526.21
45(blank) Total27.5309,623.53
46Due in 7 DaysAwaiting Manual Match105325,208.51
47Awaiting Shipment Recipt Warehouse10180,630.14
48Awaiting System Match2.52,989.39
49Awaitng FSS submission warehouse20152,456.84
50Pending Liability Creation22.5135,185.39
51Pending with Planner157.51,525,240.29
52Pending with Stores- Drag and drop not done/Handle not created520,650.46
53Due in 7 Days Total322.52,342,361.02
54Grand Total9637.567,498,224.19
55
Last Week file


thanks
aleem
 

Excel Facts

Is there a shortcut key for strikethrough?
Ctrl+S is used for Save. Ctrl+5 is used for Strikethrough. Why Ctrl+5? When you use hashmarks to count |||| is 4, strike through to mean 5.
Hi,
I tried linking with the last week's file by selecting the GET Pivot Data data and replacing it with the cell refernce. the problem I'm getting is when we send the file to another user all the last week's data is showing Ref. Error.

is there any possibility we can get this result via VBA and when we send the file to another user the reference error should not come?
 
Upvote 0

Forum statistics

Threads
1,215,066
Messages
6,122,948
Members
449,095
Latest member
nmaske

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