A method for diverting resins and other treating fluids used for sand control in wells drilled through unconsolidated subterranean formations is provided. Explosives placed in the wellbore in proximity to the treating solutions are actuated to divert the solutions through all perforations in the casing of the well and allow sand-free production of fluids through the well.