The transverse target spin azimuthal asymmetry A_UT in hard exclusive production of rho^0 mesons was measured at COMPASS by scattering 160 GeV/c muons off transversely polarised protons and deuterons. The measured asymmetry is sensitive to the nucleon helicity-flip generalised parton distributions E^q, which are related to the orbital angular momentum of quarks in the nucleon. The Q^2, x_B and p_t^2 dependence of A_UT is presented in a wide kinematic range. Results for deuterons are obtained for the first time. The measured asymmetry is small in the whole kinematic range for both protons and deuterons, which is consistent with the theoretical interpretation that contributions from GPDs E^u and E^d approximately cancel.