Senin, 20 Februari 2012

[ExcelVBA] Copy and Paste Columns from one Workbook to Another, based on Column Heading

 

Hi,

I currently have a macro that will open up a source workbook and copy several columns of data and then go back and paste those columns into my results workbook. It will then open a second source workbook and copy the same columns again and go back and paste those columns into my results workbook beneath the previous data that was imported. Then this is repeated once more. So there are a total of 3 different workbooks where I copy a set group of columns and bring them back to my results workbook with the data of each appended beneath the previous all on one worksheet.

The problem I'm faced with now is that because my macro copies defined ranges, some of the columns in the source workbooks get moved around sometimes when new ERP changes are pushed out that I don't know about, hence all of my data coming in is no longer what it was because things get shifted.

I need to be able to copy in columns of data from the source workbook based on the column headers. That way, no matter where a column of data may get moved to in the source workbooks when an ERP update is pushed out, I still get the same data.

Any ideas on how to get there?

Thanks,

Steve

__._,_.___
Recent Activity:
----------------------------------
Be sure to check out TechTrax Ezine for many, free Excel VBA articles! Go here: http://www.mousetrax.com/techtrax to enter the ezine, then search the ARCHIVES for EXCEL VBA.

----------------------------------
Visit our ExcelVBA group home page for more info and support files:
http://groups.yahoo.com/group/ExcelVBA

----------------------------------
More free tutorials and resources available at:
http://www.mousetrax.com

----------------------------------
.

__,_._,___

Tidak ada komentar:

Posting Komentar