+ Reply to Thread
Results 1 to 3 of 3

declaring public array?

  1. #1
    Registered User
    Join Date
    01-16-2013
    Location
    WI
    MS-Off Ver
    Professional 2007
    Posts
    13

    declaring public array?

    I have a workbook which refers to the same set of cells in several sub procedures. Since I'm pretty new to VBA, I wound up creating an array to store the contents of those cells. Also since I'm new, I'm "recreating" the same array in each sub procedure, rather than creating it once for the module and then having each procedure access the existing array. Since one of these sub procedures is event triggered (mousemove) I think it's really slowing down my code.

    Can anyone help me change my code to create the array one time and make it available to all the procedures?

    Thanks!

    Here's a sample of my existing code with just two of the procedures:
    Please Login or Register  to view this content.
    Last edited by desertsp; 01-25-2013 at 12:12 PM. Reason: include example of current code

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: declaring public array?

    declare array before all subs
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Registered User
    Join Date
    01-16-2013
    Location
    WI
    MS-Off Ver
    Professional 2007
    Posts
    13

    Re: declaring public array?

    That seems to have done the trick. Unfortunately it didn't speed up the code noticeably.

+ 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