Forum Discussion
jdebaise
Sep 03, 2020Copper Contributor
Excel VBA "For loop" does not respond
I had a problem debugging a VBA program. I could not step into a "For loop". I wrote a simple loop to see if the problem was persistent. This file is attached. When I open Module1 and attempt to ...
HansVogelaar
Sep 03, 2020MVP
A macro is a piece of code that begins with Sub macroname() and ends with End Sub.
Both are missing from your code.
It should look like this:
Sub Test()
Dim i As Integer
For i = 0 To 10
Range("A1").Select
Selection.End(xlDown).Select
Selection.Offset(1, 0).Select
Paste
Next i
End Sub
You will then be able to step into the code etc.