Hi All
I have been sweeping the internet to find some vba code that compares columns, in my case columns A, D, E, F to find unique rows then append it to the bottom of the Master Spreadsheet.
All I have managed to find is code that just copies the data from spreadsheet to spreadsheet.
Below is examples of the spreadsheet
Master Spreadsheet (to be appended to)
So the spreadsheet below will contain new rows of date and all the columns in this spreadsheet needs to be compared with the master sheet above. Columns that need to be compared is Territory, Publisher , Assigned, Returned. which have the same names as in the master spreadsheet above.
the sheet below has a row 22 the is not present in the master so would need to be added the master spreadsheet. Please note that new row could appear anywhere in the sheet and not necessarily at the bottom/
Any advice and starter code would be greatly appreciated.
I have been sweeping the internet to find some vba code that compares columns, in my case columns A, D, E, F to find unique rows then append it to the bottom of the Master Spreadsheet.
All I have managed to find is code that just copies the data from spreadsheet to spreadsheet.
Below is examples of the spreadsheet
Master Spreadsheet (to be appended to)
Perry Hill Territory Spreadsheet.xlsm | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | |||
2 | Territory | Territory Name | Campaign | Publisher | Assigned | Returned | Days Assigned | Last Allocated | Status | Notes | ||
3 | 1 | Dacres Road | 2 | John Doe 1 | 16/04/2016 | 16/05/2016 | 30 | 1981 | OK | |||
4 | 1 | Dacres Road | 1 | John Doe 2 | 22/04/2016 | 18/05/2016 | 26 | 1979 | OK | |||
5 | 1 | Dacres Road | John Doe 3 | 22/04/2016 | 08/07/2016 | 77 | 1928 | Overdue | ||||
6 | 1 | Dacres Road | John Doe 4 | 11/05/2016 | 27/06/2016 | 47 | 1939 | Overdue | ||||
7 | 1 | Dacres Road | John Doe 5 | 14/05/2016 | 25/06/2016 | 42 | 1941 | Overdue | ||||
8 | 1 | Dacres Road | John Doe 6 | 20/05/2016 | 04/07/2016 | 45 | 1932 | Overdue | ||||
9 | 1 | Dacres Road | John Doe 7 | 01/06/2016 | 20/07/2016 | 49 | 1916 | Overdue | ||||
10 | 1 | Dacres Road | John Doe 8 | 03/06/2016 | 01/07/2016 | 28 | 1935 | OK | ||||
11 | 1 | Dacres Road | John Doe 9 | 03/06/2016 | 08/07/2016 | 35 | 1928 | Overdue | ||||
12 | 1 | Dacres Road | John Doe 10 | 08/06/2016 | 13/07/2016 | 35 | 1923 | Overdue | ||||
13 | 1 | Dacres Road | John Doe 11 | 11/06/2016 | 16/08/2016 | 66 | 1889 | Overdue | ||||
14 | 1 | Dacres Road | John Doe 12 | 29/07/2016 | 07/08/2016 | 9 | 1898 | OK | ||||
15 | 1 | Dacres Road | John Doe 13 | 31/07/2016 | 14/08/2016 | 14 | 1891 | OK | ||||
16 | 1 | Dacres Road | John Doe 14 | 02/08/2016 | 21/09/2016 | 50 | 1853 | Overdue | ||||
17 | 1 | Dacres Road | John Doe 15 | 05/08/2016 | 19/08/2016 | 14 | 1886 | OK | ||||
18 | 1 | Dacres Road | John Doe 16 | 06/08/2016 | 14/08/2016 | 8 | 1891 | OK | ||||
Assignment |
Cell Formulas | ||
---|---|---|
Range | Formula | |
G3:G18 | G3 | =IF(ISBLANK(F3),TODAY()-E3,F3-E3) |
H3:H18 | H3 | =IF(ISBLANK(F3),"ALLOCATED",TODAY()-F3) |
I3:I18 | I3 | =IF(G3>30,"Overdue","OK") |
B3:B18 | B3 | =INDEX(Territory!$A$2:$C$37,MATCH(Assignment!A3,Territory!$A$2:$A$37,0),2) |
Cells with Data Validation | ||
---|---|---|
Cell | Allow | Criteria |
E3:F18 | Date | between 01/01/2016 and 31/12/2022 |
A3:A18 | Whole number | between 1 and 35 |
So the spreadsheet below will contain new rows of date and all the columns in this spreadsheet needs to be compared with the master sheet above. Columns that need to be compared is Territory, Publisher , Assigned, Returned. which have the same names as in the master spreadsheet above.
the sheet below has a row 22 the is not present in the master so would need to be added the master spreadsheet. Please note that new row could appear anywhere in the sheet and not necessarily at the bottom/
Perry Assignments_All data 18102021.xlsx | |||||||
---|---|---|---|---|---|---|---|
A | B | C | D | E | |||
5 | Territory | Campaign | Publisher | Assigned | Returned | ||
6 | 14 | John Doe 1 | 16/04/2016 | 16/05/2016 | |||
7 | 6 | John Doe 2 | 22/04/2016 | 18/05/2016 | |||
8 | 2 | John Doe 3 | 22/04/2016 | 08/07/2016 | |||
9 | 5 | John Doe 4 | 11/05/2016 | 27/06/2016 | |||
10 | 1 | John Doe 5 | 14/05/2016 | 25/06/2016 | |||
11 | 11 | John Doe 6 | 20/05/2016 | 04/07/2016 | |||
12 | 7 | John Doe 7 | 01/06/2016 | 20/07/2016 | |||
13 | 27 | John Doe 8 | 03/06/2016 | 01/07/2016 | |||
14 | 32 | John Doe 9 | 03/06/2016 | 08/07/2016 | |||
15 | 25 | John Doe 10 | 08/06/2016 | 13/07/2016 | |||
16 | 28 | John Doe 11 | 11/06/2016 | 16/08/2016 | |||
17 | 15 | John Doe 12 | 29/07/2016 | 07/08/2016 | |||
18 | 6 | John Doe 13 | 31/07/2016 | 14/08/2016 | |||
19 | 11 | John Doe 14 | 02/08/2016 | 21/09/2016 | |||
20 | 1 | John Doe 15 | 05/08/2016 | 19/08/2016 | |||
21 | 2 | John Doe 16 | 06/08/2016 | 14/08/2016 | |||
22 | 14 | John Doe 24 | 06/08/2016 | 22/08/2016 | |||
Sheet1 |
Any advice and starter code would be greatly appreciated.