We study weighted Poincare and Poincare-Sobolev type inequalities with an explicit analysis on the dependence on the $A_p$ constants of the involved weights. We obtain inequalities of the form $$ left (frac{1}{w(Q)}int_Q|f-f_Q|^{q}wright )^frac{1}{q}le C_well(Q)left (frac{1}{w(Q)}int_Q | abla f|^p wright )^frac{1}{p}, $$ with different quantitative estimates for both the exponent $q$ and the constant $C_w$. We will derive those estimates together with a large variety of related results as a consequence of a general selfimproving property shared by functions satisfying the inequality $$ frac{1}{|Q|}int_Q |f-f_Q| dmu le a(Q), $$ for all cubes $Qsubsetmathbb{R}^n$ and where $a$ is some functional that obeys a specific discrete geometrical summability condition. We introduce a Sobolev-type exponent $p^*_w>p$ associated to the weight $w$ and obtain further improvements involving $L^{p^*_w}$ norms on the left hand side of the inequality above. For the endpoint case of $A_1$ weights we reach the classical critical Sobolev exponent $p^*=frac{pn}{n-p}$ which is the largest possible and provide different type of quantitative estimates for $C_w$. We also show that this best possible estimate cannot hold with an exponent on the $A_1$ constant smaller than $1/p$. We also provide an argument based on extrapolation ideas showing that there is no $(p,p)$, $pgeq1$, Poincare inequality valid for the whole class of $RH_infty$ weights by showing their intimate connection with the failure of Poincare inequalities, $(p,p)$ in the range $0<p<1$.