ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Merge text in sequential order (https://www.excelbanter.com/excel-discussion-misc-queries/96813-merge-text-sequential-order.html)

BCNU

Merge text in sequential order
 
I have several files where I am trying to merge data in sequential order and
make into 1 file.
Sheet 1 col a is the master. col b and c have data already which I won't
change. col d is next empty column.

Sheet 2 has several values that I want to merege into sheet 1 at the
appropriate place so all values are in sequential order.

If Sheet 2's value is the same as something already on sheet 1, I just want
to copy it to the same row, but in col d. If Sheet 2's value doesn't exist
on Sheet 1, I want to insert a row and paste the value in column a and d.

Data now looks like this:
col a col b col c col d
1a34f45 dummy data
1a35111 more data

Sheet 2 looks like this
col a
1a34f46
1a35111

I would want the final sheet 1 to look like this
col a col b col c col d
1a34f45 dummy data
1a34f46 1a34f46 (new row, data
entered twice)
1a35111 more data 1a35111 (matched, so just copied
to col d)

Hope this makes sense. I've got a loop with if then stmts but I'm sure
there is a more efficient way to do this.
--
Thanx

BCNU

Merge text in sequential order
 
I'm really looking for the sort macro, I've seen one where you set a temp
holder, compare it to the next value, if less than switch values etc. I can
do the rest. Not sure if this posting will cause it to look like the request
is closed.
--
Thanx


"BCNU" wrote:

I have several files where I am trying to merge data in sequential order and
make into 1 file.
Sheet 1 col a is the master. col b and c have data already which I won't
change. col d is next empty column.

Sheet 2 has several values that I want to merege into sheet 1 at the
appropriate place so all values are in sequential order.

If Sheet 2's value is the same as something already on sheet 1, I just want
to copy it to the same row, but in col d. If Sheet 2's value doesn't exist
on Sheet 1, I want to insert a row and paste the value in column a and d.

Data now looks like this:
col a col b col c col d
1a34f45 dummy data
1a35111 more data

Sheet 2 looks like this
col a
1a34f46
1a35111

I would want the final sheet 1 to look like this
col a col b col c col d
1a34f45 dummy data
1a34f46 1a34f46 (new row, data
entered twice)
1a35111 more data 1a35111 (matched, so just copied
to col d)

Hope this makes sense. I've got a loop with if then stmts but I'm sure
there is a more efficient way to do this.
--
Thanx



All times are GMT +1. The time now is 02:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com