ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   merge excell data (https://www.excelbanter.com/excel-programming/353923-merge-excell-data.html)

[email protected]

merge excell data
 
I need to merge two excel docs. Both have the exact same colomns of
data. But I updated some of the cells in the new document. I need to
merge those new cells into the apropriate rows and leave all other data
unchanged in the old document.

Unfortunatly, there really is no reference in the old or new document
that points to the specific row with the cells that needs to be
updated.

I could specify the rows by number in each doc if need be.

Thanks,

Sam


Toppers

merge excell data
 
Sam,
Would it be viable to do a cell by cell comparsion of old and
new and subsitute old with new where differences occur [this assumes same
number of rows/columns with only changes in cells in a row i.e no rows
deleted/added]?

Or better, are changes always in a few columns to limit the checking?

what are volumes involved (Rows/columns)

" wrote:

I need to merge two excel docs. Both have the exact same colomns of
data. But I updated some of the cells in the new document. I need to
merge those new cells into the apropriate rows and leave all other data
unchanged in the old document.

Unfortunatly, there really is no reference in the old or new document
that points to the specific row with the cells that needs to be
updated.

I could specify the rows by number in each doc if need be.

Thanks,

Sam



[email protected]

merge excell data
 
Hi Toppers, Thanks for the info!

Not same number of rows/columns. Not limited to rows or columns -
random.

Volume is small, rows x columns is 761x9 in the old doc. 37x9 in the
new doc.

Here is an example of what I did to help us both better understand the
issue that needs help.

Let's say I'd a worksheet with 100 rows and 10 columns. Lets say the
columns are respectivly for last name, first name, street, etc.... and
each row is a diferent contact.

In each row, some of the data was incorect. Wether it be the name,
street, or whatever. Some of the rows had incorect data in random
cells.

I took, for example sake, 25 random rows, with incorect data somewhere,
and put them into a new excel doc. THey were not consecutive rows. I
then gave it to someone to update whatever they found to be incorect in
whatever cell.

I now need to merge the new data back into the old document in it's
correct row.

Thanks,

Sam


Toppers

merge excell data
 
Sam,
I think we might have to resort your your semi-automated method
of supplying the row numbers. Construct a list of old (original) numbers and
the new ... say in columns A and B in one of the documents and then we can
loop through this list and replace.

Code in your "old" workbook ("Thisworkbook") could be along these lines:

For i=1 to 37
oldrow=worksheets("Sheet2").Range("a" & i)
newrow=worksheets("Sheet2").Range("B" & i)

ThisworkbookWorksheets("Sheet1").rows(oldrow)=Work books("Newbook").Worksheets("Sheet1").rows(newrow)
Next i

HTH

" wrote:

Hi Toppers, Thanks for the info!

Not same number of rows/columns. Not limited to rows or columns -
random.

Volume is small, rows x columns is 761x9 in the old doc. 37x9 in the
new doc.

Here is an example of what I did to help us both better understand the
issue that needs help.

Let's say I'd a worksheet with 100 rows and 10 columns. Lets say the
columns are respectivly for last name, first name, street, etc.... and
each row is a diferent contact.

In each row, some of the data was incorect. Wether it be the name,
street, or whatever. Some of the rows had incorect data in random
cells.

I took, for example sake, 25 random rows, with incorect data somewhere,
and put them into a new excel doc. THey were not consecutive rows. I
then gave it to someone to update whatever they found to be incorect in
whatever cell.

I now need to merge the new data back into the old document in it's
correct row.

Thanks,

Sam



[email protected]

merge excell data
 
One of the problems with sorting through the new rows and old rows is,
row 15 in the new book could be row 65 in the old book.

I gota admit, I'm not really sure what you mean - you are definitly
more advanced than me.

I guess what your saying is sort the old workbook so the rows in
question are numbered 1-37 equaling the new workbooks row 1-37

Then run a macro with:

For i=1 to 37
oldrow=worksheets("Sheet2").Range("a" & i)
newrow=worksheets("Sheet2").Range("B" & i)


ThisworkbookWorksheets("Sheet1").rows(oldrow)=Work books("Newbook").Workshee*ts("Sheet1").rows(newrow )

Next i


???

thakns for the help.

Sam



All times are GMT +1. The time now is 11:01 PM.

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