I am trying to debug a long code I wrote and I need to step line by line.
The thing is I am on a mac and don't know how to use an F8 in that case. Could anyone tell me how can I do that otherwise and how do I know which line is causing problems with execution?
Sub Main()
Dim lNum As Long
On Error GoTo ErrHandler
lNum = 1 / 0
ErrExit:
Exit Sub
ErrHandler:
Debug.Print Err.Description
Stop
Resume
End Sub
When you get to Stop, then Step Into twice. If you don't have F8, you should have a menu item for stepping into a line. Resume will take you back to the line that caused the error.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With