I have the following code:
Usually, when I type 'testloop' in the immediate pane, it runs the procedure and displays the numbers 1 to 5 as it should. Other times, I get the message:
"Compile error:
Expected procedure, not variable"
I have no idea what I have done that makes it possible for me to call the procedure one minute and then brings an error the next minute. Does anyone have any ideas?
EDIT: I should point out that pressing F5 runs the procedure as normal. I just can't seem to get it going from the Immediate Pane.
Code:
Sub Testloop()
Dim intcounter As Integer
For intcounter = 1 To 5
Debug.Print intcounter
Next intcounter
End Sub
Usually, when I type 'testloop' in the immediate pane, it runs the procedure and displays the numbers 1 to 5 as it should. Other times, I get the message:
"Compile error:
Expected procedure, not variable"
I have no idea what I have done that makes it possible for me to call the procedure one minute and then brings an error the next minute. Does anyone have any ideas?
EDIT: I should point out that pressing F5 runs the procedure as normal. I just can't seem to get it going from the Immediate Pane.