Re: HELP with For Next...
So, what's the problem. That looks OK to me.
If you run into other problems, post them, and we'll help.
Re: HELP with For Next...
Public Function AddRange(ByVal LowNum As Long, ByVal HighNum As Long)as Long
dim Result as Long
Result = 0
For i as integer = LowNum to HighNum
Result += i
Next i
AddRange=Result
End Function
Re: HELP with For Next...
Quote your post, and then MINE:
Code:
Public Function AddRange(ByVal LowNum As Long, ByVal HighNum As Long)as Long
dim Result as Long
Result = 0
For i as integer = LowNum to HighNum
Result += i
Next i
AddRange=Result
End Function
Re: HELP with For Next...
Either you have to check BEFORE you call that sub, or FIRST THING inside of it.
What if Low>High? Switch them...
If you can't grasp these simple concepts, you should go back to the books
Re: HELP with For Next...
Right ... So far that is correct...
Quote:
Allow for the possibility that a user may start with a high number and end with a low number.
Hint for this...
Code:
If LowNum > HighNum Then
End If