Auto generate workbooks with sheets based on list


I'm currently using a macro based on the wonderful solution presented here:

I have one sheet with a list of names in colum A, and a country in colum B. On the other sheet I have the template that should be copied on the new sheets. The macro above is working fine, creating a new sheet for every name in the first sheet, with the template copied from the second sheet.

The modification I'm now trying to make is that the macro creates a new workbook (file) for every country listed in colum B of the first sheet, with different sheets created for all names that have that country (based on the template). Would this be possible?