+ Reply to Thread
Results 1 to 3 of 3

calling/using an array

  1. #1
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201

    calling/using an array

    Hi all,

    I have to do the same procedure for a number of profit centers. The only differences are the names of these profit centers.

    Therefore I want to use the same code, with changing references

    How can I use this array so that it calls/uses 1 profit center at the time?

    If I use the following code they all are used at once (P1100P1200P1300P1500P1600P1900)

    Please Login or Register  to view this content.
    Thanks in advance
    Hein
    Last edited by Hein; 04-15-2009 at 09:09 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: calling/using an array

    You have declared the variable as a single string.
    The code is currently concatenating the values.

    this code demonstrates using a variant array and a string array.
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    06-29-2005
    Posts
    201

    Re: calling/using an array

    Thank you once again Andy!

    I have tried your suggestions and they both work (with variances on your code)

    I think I have a slight preference for the "variant - variant" because when the profit centers change in the future I (or somebody else) only have to change the array - list.
    The "string - variant" requires changes in 2 places.


    1 more question (if I may)
    I have tried to add text to the code:
    Please Login or Register  to view this content.
    This would give me the opportunity to go to named ranges (ending with P1100, P1200 etc)
    However: this gives the error message (#13) that types don't match
    strTekst however is, like str_Array a variant

    Is it at all possible to this?


    Thanks
    Hein

    PS
    Got it!!
    I have changed 1 line: strTekst = str_Array & " tekst" to strTekst = str_Array(lngIndex) & " tekst"
    This works!
    Last edited by Hein; 04-15-2009 at 08:21 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1