If I recall correctly, this does not work, as it is nearly always bad absorption of B12. However B12 injections are cheap and easy.
(I think it is something to do with changes in the gut bugs when some people take metformin, likely it depends on the types of gut bugs they had to start with, and what they are eating. But I have not seen any studies that have looked at supplements, given the money to be made selling supplements to everyone taking Metformin..... I think one company is testing a probiotic to be used alongside metformin, I don't know if it reduces the B12 risks, or just helps with the common side effects.)