I'm just curious to know if there was an easy way to do this in VBA.
Suppose I always use a counter variable in my loops, say i
and I always want, whatever i
's valuen to have another variable, say k
a certain value above or beneath it.
So, for example:
Dim i as integer
Const JumpVal = 3
Dim k as integer
k = i + JumpVal ' !!And this is to be true regardless of i's value!!
But I would want k to always be JumpVal
away from i
... I know I could do this with a simple function taking i
's value and returning an integer, but I was curious to know if there was another way to do this via assignment.
Hope this question makes sense!
Thanks!!