Find within a range & then copy

June

New Member
Joined
Nov 13, 2004
Messages
41
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:
Book1.xls
ABCDEFGHIJKLMNOP
1CustPOInvoiceDatePO_NewInvoice_NewDate_NewPO AReceipt ADate APO BReceipt BDate BPO CReceipt CDate C
2C1PO1O11-Jan-05PO13R14-Jan-05PO1R1014-Jan-05PO10R191-Feb-05
3C1PO2O21-Jan-05PO11R25-Jan-05PO12R1115-Jan-05
4C1PO3O32-Jan-05PO3R36-Jan-05PO14R1216-Jan-05PO15R213-Feb-05
5C2PO4O42-Jan-05PO20R47-Jan-05
6C2PO5O51-Jan-05PO15R58-Jan-05PO23R1418-Jan-05PO5R235-Feb-05
7C3PO6O63-Jan-05PO16R69-Jan-05PO9R1519-Jan-05PO6R246-Feb-05
8C3PO7O71-Jan-05PO17R710-Jan-05PO24R1620-Jan-05PO25R257-Feb-05
9C3PO8O84-Jan-05PO18R811-Jan-05PO25R1721-Jan-05
10C3PO9O91-Jan-05PO27R912-Jan-05PO7R1822-Jan-05PO37R279-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]
 

Some videos you may like

Excel Facts

Format cells as currency
Select range and press Ctrl+Shift+4 to format cells as currency. (Shift 4 is the $ sign).

Watch MrExcel Video

Forum statistics

Threads
1,112,798
Messages
5,542,569
Members
410,560
Latest member
1ndependent
Top