You can visit here to have a code to accomplish this task

Split Data into Multiple Workbook « excelpoweruser

Thanks
Rajan verma