How and when is the sperm collected for IUI?
If you are heterosexual couple your clinic will give you a time on the day of your procedure to collect a sperm sample in order for it to be washed and prepared for the insemination
If you are a single woman or lesbian couple you will have purchased donor sperm from a sperm bank or used a known donor’s sperm which will also have to have been frozen and tested over a six month period.
The donor sperm will then be thawed and prepared for insemination on the day of your procedure. The medical team carrying out your IUI will liaise with the embryologists who prepare the sperm sample.

Further Reading:
What does the IUI procedure involve?
When should I have IUI?
Should I get up straight away after IUI?
Is IUI painful?
What are the success rates for IUI?
Is it safe to do IUI at home?
What does washed sperm mean?
What is DIUI?
Related Articles:
Home Insemination
IVF
Natural Insemination