R
rantz
I'm working on my master thesis and I could really use some help.
I have two workbooks and I want to add information from workbook2 to
workbook1 by matching the order numbers in the different lists.
Workbook1 includes the following columns
Ordernr |Date| etc
Workbook2 includes the following columns
Ordernr| Customer | Quality | etc
I want to take the first cell in the ordernr-col from workbook1 and
search for that specific order number in the ordernr-col in woorkbook2.
When I find that number I want to take the information (Customer,
Quality) from that row in workbook2 and add this information to
workbook1. If the order number is not found in workbook2 it can be
indicated in workbook1 as blank.
I want to loop through all of order numbers in workbook1.
Perhaps this is a matter for access but I think It could be written in
excel with VBA. I'm not that good with VBA so I tried to write how I
think it could be done. Maybe someone can help me with translation or
point me in the right direction.
Do While IsEmpty(ActiveCell.Offset(1, 0)) = False
1. Read value (order number) from cell workbook1.A"currentRow"
2. Search workbook2, column A for order number and return row-number to
"foundrow"
3. Read value (Customer) from cell workbook2, B."foundrow" and write
value (customer) to workbook1, C."currentRow"
4. If order number not found, then write blank or "not found" to
workbook1, C."currentRow"
Loop
I have two workbooks and I want to add information from workbook2 to
workbook1 by matching the order numbers in the different lists.
Workbook1 includes the following columns
Ordernr |Date| etc
Workbook2 includes the following columns
Ordernr| Customer | Quality | etc
I want to take the first cell in the ordernr-col from workbook1 and
search for that specific order number in the ordernr-col in woorkbook2.
When I find that number I want to take the information (Customer,
Quality) from that row in workbook2 and add this information to
workbook1. If the order number is not found in workbook2 it can be
indicated in workbook1 as blank.
I want to loop through all of order numbers in workbook1.
Perhaps this is a matter for access but I think It could be written in
excel with VBA. I'm not that good with VBA so I tried to write how I
think it could be done. Maybe someone can help me with translation or
point me in the right direction.
Do While IsEmpty(ActiveCell.Offset(1, 0)) = False
1. Read value (order number) from cell workbook1.A"currentRow"
2. Search workbook2, column A for order number and return row-number to
"foundrow"
3. Read value (Customer) from cell workbook2, B."foundrow" and write
value (customer) to workbook1, C."currentRow"
4. If order number not found, then write blank or "not found" to
workbook1, C."currentRow"
Loop