Hi all,
I have been searching for a macro for a while now to cleanup a file that has many columns. I have five columns that are named in row 1. I want to grab only these five columns and move to a new workbook. The only catch is that this file sometimes changes and gets additional columns added but the column names never change. In total there are 20+ columns in this workbook and I just want a select few.
For example, I need a macro to scan across row 1 and find (based on the column header name) and copy the following columns: "Portfolio", "Trade Date", "Book Value", "Price Source" and "Currency". I need to skip over column names that do not match. I then want these 5 to paste over the entire column contents to a new workbook.
Any help would be appreciated. Thanks in advance!
I have been searching for a macro for a while now to cleanup a file that has many columns. I have five columns that are named in row 1. I want to grab only these five columns and move to a new workbook. The only catch is that this file sometimes changes and gets additional columns added but the column names never change. In total there are 20+ columns in this workbook and I just want a select few.
For example, I need a macro to scan across row 1 and find (based on the column header name) and copy the following columns: "Portfolio", "Trade Date", "Book Value", "Price Source" and "Currency". I need to skip over column names that do not match. I then want these 5 to paste over the entire column contents to a new workbook.
Any help would be appreciated. Thanks in advance!