Most valuable professional
  • Hot Topics

Excel Broken "Do Until" loop

Hi. I have a macro that's supposed to check many individual accounts for a stock symbol, then see if there is enough of that stock symbol in the portfolio to sell or to see if there is enough cash to buy that stock symbol. The part checking if there are enough shares to sell the amount I'm validating for is the part that's not working. If I try to validate the last account in the list of accounts, the macro checks column B indefinitely (even though the "END" is present). If I try to validate any account(s) other than the last one, it works fine. It looks like this with the (assumed) malfunctioning part in red: Code: Sub Validate() Dim TransactionType As String Dim Symbol As String Dim EstPrice As Double Dim Confirm As String Dim CurRelRow As Integer CurRelRow = 0 Dim CurShare As Integer CurShare = 0 Dim FidTotal, SchTotal, TDAtotal, OthTotal As Integer FidTotal = 0 SchTotal = 0 TDAtotal = 0 OthTotal = 0 TransactionType = Range("R1") If TransactionType = "" Then MsgBox "Please enter transaction type" Exit Sub End If Symbol = Range("R2")

This question generated 23 answers. To proceed to the answers, click here.

This thread is current as of August 27, 2014.

For more resources for Microsoft Excel:

This article includes the following tags:

  • Excel
  • Microsoft Excel