Hi All,
Sorry, need help again from you all. I'm looking somebody can advise me on how the code should look like.
The case is like this. I've a list of data from data base. A part of it as below:
What I hv to do is I need to check whether the data in columns E, H & K already exist in column B within the same customer. If the data is not exist, then I'll copy the data in the particular data set to column E, F & G.
Example for data in row 2. Customer is C1; PO= PO1. This PO hv 3 set datas.
First set data (in columns H, I & J). I've to check if the PO13 in cell H2 already exist in cells B2, B3 & B4 which are within same customer. In this case, PO13 not exist within this cellls. So the data in cells H2, I2 & J2 will be copy to cells E2, F2 & G2.
Second set data (in columns K, L & M). I will check if PO1 exist within cells B2, B3 & B4. As this PO1 already exist in B2 so nothing hv to do with this data.
Third set data (in coumns N, O & P). As the PO10 is a not a existing data, so 1 row will be added below the original data. And the data in cells N2, O2 & P2 will be copy to this added row.
This process will continuous to next row untill finish all data set. The resutl as below:
[HTML removed by admin]
Sorry, need help again from you all. I'm looking somebody can advise me on how the code should look like.
The case is like this. I've a list of data from data base. A part of it as below:
Book1.xls | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | |||
1 | Cust | PO | Invoice | Date | PO_New | Invoice_New | Date_New | PO A | Receipt A | Date A | PO B | Receipt B | Date B | PO C | Receipt C | Date C | ||
2 | C1 | PO1 | O1 | 1-Jan-05 | PO13 | R1 | 4-Jan-05 | PO1 | R10 | 14-Jan-05 | PO10 | R19 | 1-Feb-05 | |||||
3 | C1 | PO2 | O2 | 1-Jan-05 | PO11 | R2 | 5-Jan-05 | PO12 | R11 | 15-Jan-05 | ||||||||
4 | C1 | PO3 | O3 | 2-Jan-05 | PO3 | R3 | 6-Jan-05 | PO14 | R12 | 16-Jan-05 | PO15 | R21 | 3-Feb-05 | |||||
5 | C2 | PO4 | O4 | 2-Jan-05 | PO20 | R4 | 7-Jan-05 | |||||||||||
6 | C2 | PO5 | O5 | 1-Jan-05 | PO15 | R5 | 8-Jan-05 | PO23 | R14 | 18-Jan-05 | PO5 | R23 | 5-Feb-05 | |||||
7 | C3 | PO6 | O6 | 3-Jan-05 | PO16 | R6 | 9-Jan-05 | PO9 | R15 | 19-Jan-05 | PO6 | R24 | 6-Feb-05 | |||||
8 | C3 | PO7 | O7 | 1-Jan-05 | PO17 | R7 | 10-Jan-05 | PO24 | R16 | 20-Jan-05 | PO25 | R25 | 7-Feb-05 | |||||
9 | C3 | PO8 | O8 | 4-Jan-05 | PO18 | R8 | 11-Jan-05 | PO25 | R17 | 21-Jan-05 | ||||||||
10 | C3 | PO9 | O9 | 1-Jan-05 | PO27 | R9 | 12-Jan-05 | PO7 | R18 | 22-Jan-05 | PO37 | R27 | 9-Feb-05 | |||||
Sheet1 |
What I hv to do is I need to check whether the data in columns E, H & K already exist in column B within the same customer. If the data is not exist, then I'll copy the data in the particular data set to column E, F & G.
Example for data in row 2. Customer is C1; PO= PO1. This PO hv 3 set datas.
First set data (in columns H, I & J). I've to check if the PO13 in cell H2 already exist in cells B2, B3 & B4 which are within same customer. In this case, PO13 not exist within this cellls. So the data in cells H2, I2 & J2 will be copy to cells E2, F2 & G2.
Second set data (in columns K, L & M). I will check if PO1 exist within cells B2, B3 & B4. As this PO1 already exist in B2 so nothing hv to do with this data.
Third set data (in coumns N, O & P). As the PO10 is a not a existing data, so 1 row will be added below the original data. And the data in cells N2, O2 & P2 will be copy to this added row.
This process will continuous to next row untill finish all data set. The resutl as below:
[HTML removed by admin]