Cellular manufacturing system is one of the most important applications of group technology. Design of this system involves many structural and operational issues, in which the cell formation and production planning are two important steps. In this paper, a new mathematical model is proposed for integration of cell formation and production planning problems with the aim of minimizing the overall costs such as machine, inter-cell and intra-cell movements, reconfiguration, tool consumption inventory holding, backorders and partial subcontracting based on tooling available in dynamic condition. Since the cell formation problem is NP-hard, an extended particle swarm optimization is presented. In the proposed algorithm, we use the local best for updating the particle position and re-initialize the worst particles positions to increase diversity and prevent premature convergence. Comparison of the proposed algorithm with LINGO 8.0 software in small size problem and with the standard particle swarm optimization in large size problem shows the efficiency of the presented approach.