Hello,
I need a function that gets a variable number (byte its Ok), and do the following:
if the variable is 1 it will do the resulte of this function:
if the the variable is 2 it will do the resulte of this function:
if the the variable is 3 it will do the resulte of this function:
and so on........
of course it should be dynamic, dont use "select case" (for the variable) or somthing like that.
I think it needs to be a recursive function, but I'm not sure.
I need a function that gets a variable number (byte its Ok), and do the following:
if the variable is 1 it will do the resulte of this function:
VBA Code:
For Each v In Array(1, 2, 3, 4)
Debug.Print v
Next
if the the variable is 2 it will do the resulte of this function:
VBA Code:
For Each v In Array(1, 2, 3, 4)
For Each vv In Array(1, 2, 3, 4)
Debug.Print v, vv
Next
Next
if the the variable is 3 it will do the resulte of this function:
VBA Code:
For Each v In Array(1, 2, 3, 4)
For Each vv In Array(1, 2, 3, 4)
For Each vvv In Array(1, 2, 3, 4)
Debug.Print v, vv, vvv
Next
Next
Next
and so on........
of course it should be dynamic, dont use "select case" (for the variable) or somthing like that.
I think it needs to be a recursive function, but I'm not sure.