It highlights this sub:
What it highlights is in bold. Please help. i do not understand why it is doing this...Code:Public Sub CalculateBD(txtInput As TextBox, lblOutput As Label, lengthfornumber As Long) Dim i Dim character(Len(txtInput.Text)) For i = 1 To Len(txtInput.Text) character(i) = Mid$(txtInput.Text, i, 1) If character(i) = "0" Or character(i) = "1" Then Else Call MsgBox("The data you entered is not a 1 or a 0! ", vbCritical Or vbDefaultButton1, "Incorrect Data!") Exit Sub End If Next i Dim multiplynumber As Long multiplynumber = 1 For i = lengthfornumber To 1 Step -1 If i = lengthfornumber Then multiplynumber = 1 Else multiplynumber = multiplynumber * 2 End If If character(i) = "1" Then lblOutput.Caption = lblOutput.Caption + multiplynumber End If Next i End Sub




Reply With Quote