PDA

View Full Version : Associate 1 workbook with another to copy columns



simora
01-22-2008, 03:25 PM
Need VBA to open both a New workbook then Select an old Workbook.

Associate sheets 1- 13 of Old WorkBook to sheets 1 - 13 of New WorkBook

Loop through them and match
Col A of each old worksheet to the
Col A of each new worksheet and if the same,
copy matching rows so that
Cols Z Old sheet copies to Col E New sheet

If Columns A AND Columns S on the old sheet are matched to the same columns on the new sheet, then copy
column Y from old sheet to the new one.
Else copy col A and put it in RED on the new sheet while other values from Col S are copied as they were.

Problem is also that sheet names may change from time to time, so I have to use sheet positions. eg Sheet 1 is really position 1

Associating the various sheet numbers from sheet to sheet on the 2 different worksheets is a real problem with the lopin etc...

Thanks for any help.