This paper develops a dynamic model of trade and growth that we use to study how openness affects economic growth. In our model, heterogeneous firms choose to either produce with their existing technology or search within the domestic economy to adopt a better technology. These choices determine the productivity distribution from which firms can acquire new technologies and, hence, the equilibrium rate of technological diffusion. Opening to trade changes the relative profitability between high and low productivity firms through expanded export opportunities and foreign competition. These reallocation effects change the timing of when firms adopt new technologies and, thus, the rate of technological diffusion. This results in growth effects from openness via within-firm productivity improvements.