When I am in Excel's VBA editor and I am writing a sub or a function that is not requiring variables to be passed to it, I can simply press F8 and step through the code I have written line by line, or if I have a break point set jump ahead to that spot.
However, if the function requires some variable to be passed to it such as the following:
Public Function MAXIF(ByVal rgeCriteria As Range, _
ByVal sCriteria As String, _
ByVal rgeMaxRange As Range) As Single
I run in to problems. I usually move the variables from the top into to the body, DIM them and assign them their values.
What is the best way to step through to see your code in action?
I believe its slightly different than this question am asking about hot to step through something that is passing variables. The other question is asking how to write a function that give no output. The answer is good and its explanation of byval and byref was interesting. The answer would definitely apply here, but the question is slightly different.