I'm getting started on this "wizard" file to automate some Excel (2016) tasks, and I have run into a problem with the Step Into tool in VBA (7.1). Here's my code:
Public LastInitial As Integer
Sub FormatRecipeFile()
'Get the row number of the last
'initial listed in column D:
LastInitial = Range("D" & Rows.Count).End(xlUp).Row
'Prints "9" in cell F5:
Range("F5").Value = LastInitial
'The first initial is cell D3, so set j to 3:
For j = 3 To LastIntitial
'Set each intial to a new value:
Range("D" & j).Value = Range("D" & j).Value & " (done)"
Next j
End Sub
The public variable must be public for future use. Printing "9" in F5 is my way of checking that there are items to cycle through in the For Loop.
The issue is that when hitting F8, each line of code is executed perfectly, and it even highlights "For j = 3 To LastInitial", but when I hit F8 again it jumps down to "End Sub" without running anything inside the For Loop.
Hi it appears that you have a typo in the line
It should probably read