I have a macro that looks up a number and copies the information if it's an old account.
The first msgbox displays perfectly; it pops up, I hit "ok" and it continues the code and moves to the next iteration. The next message box, however, continues to pop up when I hit "ok" and I don't know why it won't move to the next iteration. The layout looks the same to me, the iterative piece is on the outside of both "End If" statements, right before End Sub, so it seems as though it should move through correctly.
I'm not sure if this is clear, but any help would be greatly appreciated because I'm not sure what I'm doing wrong!
Thanks!
The first msgbox displays perfectly; it pops up, I hit "ok" and it continues the code and moves to the next iteration. The next message box, however, continues to pop up when I hit "ok" and I don't know why it won't move to the next iteration. The layout looks the same to me, the iterative piece is on the outside of both "End If" statements, right before End Sub, so it seems as though it should move through correctly.
Code:
Do While Cells(i, 1).Value <> ""
If IP.Range("B" & i) = "New" Then
MsgBox "Account is 'new'. Please enter account details."
Else
Set Num = IP.Range("A" & i)
Num.Copy
OP.Activate
x = WorksheetFunction.CountIf(Range("C:C"), Num.Value)
If x = 0 Then
MsgBox "Number " & Num & "was not found. Please check the number and try again."
Else
I'm not sure if this is clear, but any help would be greatly appreciated because I'm not sure what I'm doing wrong!
Thanks!