You cannot connect two modems at the same time.
Do you mean modems, or modem/routers (usually just called routers for bevity)? Are you running Windows on the two PCs?
If you have a modem/router then that can service more than one computer, either by wired ethernet or by wireless links. That's what routers do. If it doesn't have built-in wireless you can connect a WAP, (Wireless Access Point), to it. Either or both computers can be on and accessing the internet.
If you truly have just a modem, and are running Windows, you can still share the connection with Windows Connection Sharing. That would need an ethernet cable running between the two computers - maximum cable length 100 metres. For that to work, the computer connected to the modem needs to be on in order for the other to work.
Alternatively, if you can't conveniently run that cable, you can use Powerline Adadpters
. There are a few makes.
My broadband basic info/help site - www.robertos.me.uk
| Domains,site and mail hosting - Tsohost
Connection - Plusnet
UnLim Fibre (FTTC). Sync ~ 59.4/14.4Mbps @ 600m. - BQM
"Where talent is a dwarf, self-esteem is a giant."
- Jean-Antoine Petit-Senn.
Allergy information: This post was manufactured in an environment where nuts are present. It may include traces of understatement, litotes and humour.