Hi everyone, I'm still new to VBA so please forgive me if there is any mistake describing the situation.
So basically I want to create a macro that copy columns from a Sheet, these columns have to match headers in another Sheet, to a new workbook.
Workbook 1 has Sheet Settings (Sheet 1) and Sheet Inputfile (Sheet 2).
Sheet Inputfile has data with columns headers for each columns.
Sheet Settings has Column Name column, user will enter the columns that they want to copy in this column (the columns name are from Sheet Inputfile).
I want to create a macro that copy columns from Sheet Inputfile to a new Workbook, these columns's headers have to matched the headers in the Output line (at row 10 starting at Cells "E10") in Sheet Settings. The order of the columns in the new Workbook has to be the same in the Output line.
After succesfully copy the wanted columns to a new workbook, I keep getting this problem,the macro always sees column "Procedure" as "Test Name". And it's still working fine for other columns.
For example: I want to copy columns: "Procedure", "Key", "Test Name" and "A time [min]", when it copies to a new Workbook, the Workbook shows columns "Test Name", "Key", "Test Name" and "A time [min]".
Can someone help me to find what the error is here? You can see the attached file for more details.
Also how can I save the new Workbook as a text file in the same directory with the Workbook?
Any help would be appreciated.
Thank you.
Bookmarks