title: "While .. End While" doesn't work in VBA?
body: <p>The code below is VBA for Excel. I am using the Visual Basic editor that comes with Excel 2007.  </p>
  
  <pre><code>Dim counter As Integer
  counter = 1
  While counter &lt; 20
      counter = counter + 1
  end while '&lt;- the compiler is complaining about this statement
  </code></pre>
  
  <p>The code doesn't compile. Above the code I have only declarations. According to <a href="http://msdn.microsoft.com/en-us/library/zh1f56zs.aspx">MSDN</a>   this should work but it doesn't. What has happened?</p>