In this study, the dynamic buckling of an elastic cylindrical shell with variable thickness, subject to a uniform external pressure which is a power function of time, has been considered. Initially, the fundamental relations and Donnell-type dynamic buckling equation of an elastic cylindrical shell with variable thickness have been obtained. Then, employing Galerkin's method, these equations have been reduced to a time-dependent differential equation with variable coefficients. Finally, applying a special Ritz-type method, the critical static and dynamic loads, the corresponding wave numbers and dynamic factor have been found analytically. Using those results, the effects of the variation of the thickness with a linear, a parabolic or an exponential function in the axial direction and the effect of the variation of the power of time in the external pressure expression are studied using pertinent computations. It is observed that these effects change appreciably the critical parameters of the problem. The present method has been verified, comparing the results of the present work and those of previous works in the literature, for a shell with constant thickness subject to a uniform external pressure varying linearly with time.