We analyze the effect of a linear time variation of the interaction strength on a trapped one-dimensional Bose gas confined to an optical lattice. The evolution of different observables such as the experimentally accessible on site particle distribution are studied as a function of the ramp time by using time-dependent numerical techniques. We find that the dynamics of a trapped system typically displays two regimes: For long ramp times, the dynamics is governed by density redistribution, while at short ramp times, local dynamics dominates as the evolution is identical to that of an homogeneous system. In the homogeneous limit, we also discuss the nontrivial scaling of the energy absorbed with the ramp time.