This paper tests the balance sheet theory, where the status of balance sheets affects the economy's response to monetary and other shocks. The theory predicts a positive effect of cash flow on investment, given fundamental determinants of investment. I use an empirical method developed by Gilchrist and Himmelberg (1995, 1999), which has previously only been used to study very large, publicly traded firms. In contrast, this paper uses a large Swedish data set with many smaller firms, where balance sheet effects are likely to be especially important. I find that a firm's cash flow has a positive impact on its investment, controlling for any information in cash flow about investment opportunities. As predicted by the balance sheet channel, the estimated effect of cash flow on investment is especially large for firms which, a priori, are more likely to be financially constrained (low-dividend, small and non-group firms). Moreover, the investment-cash flow sensitivity is significantly larger and more persistent during the first half of the sample period, which includes a severe banking crisis and recession, than during the second half.