S
stupler
This doesn't have anything to do with my other recent question but I'd
like to ask your help once again. If you don't know I'm new at the
whole VBA thing so if its obvious, please don't moan.
I've got a macro running that keeps displaying the same box (UserForm1)
again and again when you click the cross. When debugging it, it comes up
with this:
Code:
--------------------
Sub DealorNoDeal()
Do While Not Range("C30") = 1
If Range("D12") = 5 Then
UserForm1.Show
*End If*
Loop
Do While Not Range("C30") = 1
If Range("D12") = 8 Then
UserForm1.Show
End If
Loop
Do While Not Range("C30") = 1
If Range("D12") = 11 Then
UserForm1.Show
End If
Loop
Do While Not Range("C30") = 1
If Range("D12") = 14 Then
UserForm1.Show
End If
Loop
Do While Not Range("C30") = 1
If Range("D12") = 17 Then
UserForm1.Show
End If
Loop
Do While Not Range("C30") = 1
If Range("D12") = 20 Then
UserForm1.Show
End If
Loop
End Sub
--------------------
The first "End If" is highlighted yellow. What's wrong with the code
and is there a way you can guide me to to stop it doing itself again
and again?
And is it even possible to tell from that?
like to ask your help once again. If you don't know I'm new at the
whole VBA thing so if its obvious, please don't moan.
I've got a macro running that keeps displaying the same box (UserForm1)
again and again when you click the cross. When debugging it, it comes up
with this:
Code:
--------------------
Sub DealorNoDeal()
Do While Not Range("C30") = 1
If Range("D12") = 5 Then
UserForm1.Show
*End If*
Loop
Do While Not Range("C30") = 1
If Range("D12") = 8 Then
UserForm1.Show
End If
Loop
Do While Not Range("C30") = 1
If Range("D12") = 11 Then
UserForm1.Show
End If
Loop
Do While Not Range("C30") = 1
If Range("D12") = 14 Then
UserForm1.Show
End If
Loop
Do While Not Range("C30") = 1
If Range("D12") = 17 Then
UserForm1.Show
End If
Loop
Do While Not Range("C30") = 1
If Range("D12") = 20 Then
UserForm1.Show
End If
Loop
End Sub
--------------------
The first "End If" is highlighted yellow. What's wrong with the code
and is there a way you can guide me to to stop it doing itself again
and again?
And is it even possible to tell from that?