• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Macro that will produce 2 output csv file based on source

Hi,

I had a situation;

I have one main csv file namely - "Downloaded_Data" which basically the master or the primary source file.
Then there are multiple csv files that file name begins with s - on this sample I given one file only namely - "S12345.csv" (but it might come in multiple files like S2345, etc.)

Base on this files above which will be always in standard column name and column arrangement, there is a common column which is "Dest_ID" and "VPN"
Now here's the thing what macro should do;

1.) Club together all the file that are begins with S in one csv file. (In this example i have "S12345.csv" (but it might come in multiple files like S2345, etc.)
2.) Trim all the "Dest_ID" and "VPN" just to make sure unnecessary space won't come in both "Downloaded_Data" and the "Club file that begins with S"
2.) Concatenate the "Dest_ID" and "VPN" column of both "Downloaded_Data" file and those csv files that begins with S in this sample it is"S12345".
3.) After concatenating it should do a vlookup or match the "Club files that begin with S" against "Downloaded_Data" base on "Dest_ID" and "VPN" concatenation. (If no match it should mentioned "not found" in the output)
4.) Then it should produce 2 files the criteria of 2 files are
A.) if the result of number 3 process is the Container_ID contains "FOLD" it should output the file "Output-Fold.csv"
see attached file how the output should look like based on the result of process 3 against "Downloaded_Data"
B.) if the result of number 3 process is the Container_ID contains "HANG" it should output the file "Output-Hang.csv"
see attached file how the output should look like based on the result of process 3 against "Downloaded_Data"
5.) Process 4 should be sorted by Location_Id

Ideally there should be a one separate macro file that when the user click the "Process" button it should do the above 5 mentioned process.

Please see all attached file.

Thank You So Much In Advance
 

Attachments

Last edited:
Top