VBA Macro - Copy and paste data match by column headings
i Guys,
For the VBA code in the attachment below, if let's say i wanted to only copy and paste data matched by column headings, how can that be done?
What i'm trying to do is to copy all data under the specific column headings listed in MasterData sheet from the source file where the column headings match.
Can i also ask if how could the code be modified such that instead of column F "Copy to Sheet", i would like to copy to a new excel workbook instead with the spreadsheet named with variable "Item No"?
Could someone please help? Many many thanks.
Attachment | Size |
---|---|
VBAmacroCpyDataFiles.xlsm | 127.9 KB |
Addendum B - Xichlo Mobile NETWORK INFORMATION SHEET 288 2015-02-26.xls | 144 KB |
You could do the
You could do the following:
Assuming that the column headings are in the first column
1. Loop from first column of the first row in source sheet and obtain each column name. During each loop make sure you copy the data for that column.
2. Inside the main loop create another loop searching for that particular column , if it is found copy the data to destination.