excelcraze
Board Regular
- Joined
- Sep 10, 2012
- Messages
- 81
Hello,
I have been trying to debug following code since yesterday, but am failed. Can somebody help me please?
I actually don't know For... Next loop. I was just trying to create my own for the project I have.
I use F8 and see what'a happening but even when the value matches it doesn't execute comments what's after 'Then'
I have been trying to debug following code since yesterday, but am failed. Can somebody help me please?
I actually don't know For... Next loop. I was just trying to create my own for the project I have.
I use F8 and see what'a happening but even when the value matches it doesn't execute comments what's after 'Then'
Code:
Private Sub CommandButton1_Click()
Me.Hide
Application.ScreenUpdating = False
Sheets("Add").Select
lr = Application.WorksheetFunction.Count(Range("A:A"))
For i = 1 To lr
If Range("A" & i).Value = frmPBill.cbSelectCustID.Value Then
frmViewPBills.lblPBillID.Caption = frmPBill.cbSelectCustID.Value
frmViewPBills.Show
Else
End If
MsgBox "Customer (" & frmPBill.cbSelectCustID.Value & ") does not exist"
Next i
End Sub