+ Reply to Thread
Results 1 to 4 of 4

global 2 column array

  1. #1
    Registered User
    Join Date
    12-04-2012
    Location
    in oracle
    MS-Off Ver
    Excel 2007
    Posts
    2

    global 2 column array

    Hi everyone,

    First post , I am using Excel 2007.

    I'm having a problem with something that I think should be easy to do. I'm trying to create a global 2 column array, from what I could understand I'm supposed to declare an array outside of any procedure and then initialize that array during a load event, userform_initialize. However, I am unable to produce code that works as such can someone please show me a simple example of creating and using a global 2 column array in VB. Any help would be greatly appreciated.

    Currently, I have the following array created during a click event but I can't use it outside of click event without having to repeat the code.


    HTML Code: 
    Thanks,
    Oscar

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645
    Where have you declared Invest1 etc?
    If posting code please use code tags, see here.

  3. #3
    Registered User
    Join Date
    12-04-2012
    Location
    in oracle
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: global 2 column array

    Hi Norie,

    I have declared the array inside a sub, inside of the user form behind code. I know i'm not supposed to declare it there if I want it to be global but I can't produce code that works any other way. Below is where I declare the array.

    HTML Code: 

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,645

    Re: global 2 column array

    Oscar

    What doesn't work if you declare it outside all subs?

+ 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