Police were called to an address in Scholemoor Avenue, Bradford at about 7.36pm on Thursday after gunshots were reported.
Firearms officers attended and confirmed there had been a discharge with damage caused to a door and window.
The occupants of the address were found to be safe and well.
Further enquiries established that a 21-year-old man had presented himself at hospital with suspected gunshot wounds to his back.
He remains in hospital in a stable condition.
Enquiries are continuing at the scene and anyone with information is asked to contact the Homicide and Major Enquiries Team on 101 or report anonymously to Crimestoppers on 0800 555111.