title: VBA: Table Boundaries and Overflow Error 6
body: <p>I am trying to get the table boundaries of an excel sheet using VBA.  I have already done this using C#, but now I need to try and translate that code to VBA. </p>
  
  <p>One problem is that the syntax seems to be so different that the code does not look even similar, even or that it is simply doing the same thing! I think I am pretty close to figuring out the dimensions of a table but I'm getting this <code>Run-time error '6': Overflow</code> message.  </p>
  
  <p>Here's the code:</p>
  
  <pre><code>Dim currentRow As Integer
  Dim totalRow As Integer
  Dim column As Integer
  
  currentRow = 2
  
  Do
  ActiveCell.Offset(1, 0).Select
  totalRow = totalRow + 1
  Loop Until IsEmpty(ActiveCell.Offset(0, 1)) = False
  </code></pre>
  
  <p>The error occurs once it is close to being done with the <code>Do loop</code>.  I read another forum response that was saying VB is slow, and that a potential error is that the <code>Do loop</code> is going too fast and thus getting an overflow.  If that is the case, I am entirely unsure of how to solve it.  </p>
  
  <p>Does anyone have a way to fix the overflow problem?</p>