To identify credit availability we analyze the extensive and intensive margins of lending with loan applications and all loans granted in Spain. We find that both worse economic and tighter monetary conditions reduce loan granting, especially to firms or from banks with lower capital or liquidity ratios. Moreover, responding to applications for the same loan, weak banks are less likely to grant the loan. Our results suggest that firms cannot offset the resultant credit restriction by turning to other banks. Importantly the bank-lending channel is notably stronger when we account for unobserved time-varying firm heterogeneity in loan demand and quality.