The Variational Iteration Method (VIM) is an iterative method that obtains the approximate solution of differential equations. In this paper, it is proven that whenever the initial approximation satisfies the initial conditions, vim obtains the solution of Initial Value Problems (IVPs) with a single iteration. By using this fact, we propose a new algorithm for Boundary Value Problems (BVPs): linear and nonlinear ones. Main advantage of the present method is that it does not use Green's function, however, it has the same effect that it produces the exact solution to linear problems within a single, but simpler, integral. In order to show the effectiveness of the method we give some examples including linear and nonlinear BVPs. (C) 2013 Elsevier B.V. All rights reserved.