The 18-year-old man from Deighton in Huddersfield and a 17-year-old boy from Dalton are due before Kirklees Magistrates' Court.
Police said today that the 18-year-old was charged with attempted murder in relation to two incidents involving shots being fired in Holays and New House Road, Huddersfield, last week.
The 17-year-old was charged in relation to three incidents of shots being fired in Holays, New House Road and Dalton Fold.
A spokesman said: "Both were arrested following extensive enquiries into the shootings by the force's Firearms Prevent Team with support from the Homicide and Major Enquiry Team and Kirklees Police.
"Enquiries remain ongoing into the discharges and officers continue to appeal for witnesses."
Anyone who has information about any of these incidents is asked to contact the Firearms Prevent Team on 101.
They can also give information anonymously to the independent charity Crimestoppers on 0800 555111