Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Variable in For .. Next

Ho Guys

I have declared the Variable in the Back End Like Below:

Let _vYear = '=Year(Max(Today()))';

Now i want to use the above variable in my For Next statment :

For i = 2005 to $(_vYear)

-

-

-

Next

But it is not  working ....

Is there any other way to achieve the above :::::

3 Replies
alexandros17
Partner - Champion III
Partner - Champion III

Let _vYear = Year(Today());

For i = 2005 to $(_vYear)

...


Next

hope it helps

hic
Former Employee
Former Employee

You don't even need the $-expansion. The following should also work:

Let _vYear = Year(Today());

For i = 2005 to _vYear

   ...

Next i

HIC

Not applicable
Author

try this

Let _vYear = Year(Today());

For i = 2005 to $(_vYear)

...


Next   i