Looping constants

  • Hi. I need your experties guys. Is it possible to create 2 of that enclosed letter in one string?



    RESULT: "dog2"




    Reason for the need is, i have per line inputs that needs to be calculated each per year. I am calculating each in one module (publicly declared) and then call the specific string in another module.



    example:
    I have a sheet with this field...



    | #Value | #Contract | #Qty |



    I created a module to calculate each line's cost per year...




    If i need to return the value of, say, year 2, i would just call it in another module like...



    Code
    sub return_val()
        Calc_val
        Debug.Print value_Yr(2)
    end sub



    Now, I realized i need the value of "per line" per year. I don't wanna flood the module with too many calculations for each line and would just like to loop it just like how i looped it for yearly values. What should be the approach? What I was thinking is like below, but ofcourse it won't work.





    Code
    sub return_val()
        Calc_val
        Debug.Print value_Yr(2)_Line(1)
    end sub



    Thank you in advance. :)

  • Re: Looping constants


    Totally confused by that, unless you mean you want to use a multi-dimensional array

  • Re: Looping constants


    I apologize. Sometimes I confuse myself too. lol. But I think you understood what I meant. This is what I'm actually looking for. Thanks a lot!!! :)

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!