+ Reply to Thread
Results 1 to 2 of 2

How to pass a 2D+ array from a procedure to a userform

  1. #1
    Registered User
    Join Date
    02-11-2015
    Location
    toronto, canada
    MS-Off Ver
    Office 2013
    Posts
    3

    Exclamation How to pass a 2D+ array from a procedure to a userform

    Hello,

    This is my first posting here, so please be kind if my posting etiquette is not quite up to snuff.

    I am unable to access a public variable (of type Variant) within the "Private Sub UserForm_Initialize()" procedure. I get a Run-time error '13' message. Troubleshooting this, I see that the array variable is now empty.

    The goal of this in my actual vba (which is much more complicated) is to generate an array during the normal course of a Sub in Module1, and then display a userform which will populate the 2 dimensions of the array in a listbox with the contents of the array (2 columns), which displays the data to the user.

    Here is a very simplified version of what I'm trying to do...

    Module 1
    -----------
    Please Login or Register  to view this content.

    UserForm>Initialize code
    -----------------------------

    Please Login or Register  to view this content.
    Any help is much appreciated, as I've spent quite a bit of time googling without finding a clearcut answer.

    Thanks!!!

  2. #2
    Registered User
    Join Date
    02-11-2015
    Location
    toronto, canada
    MS-Off Ver
    Office 2013
    Posts
    3

    Re: How to pass a 2D+ array from a procedure to a userform

    I guess this is one of those situations where Excel decides to hiccup and a restart fixes everything.

    This works as I described once Excel was restarted.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Analyze Within An Array and Pass Back Once vs. Pass at each applicable Instance
    By AlvaroSiza in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-11-2012, 05:25 PM
  2. VBA to Pass Parameters to SQL Stored Procedure
    By ker9 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-19-2011, 01:31 PM
  3. Pass the name of a workbook to another Procedure
    By duckboy1981 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-07-2009, 10:16 AM
  4. [SOLVED] How to pass sheet reference to a procedure
    By djd in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-23-2005, 12:05 PM
  5. [SOLVED] Pass switch to Main procedure
    By Tod in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2005, 07:05 PM

Tags for this Thread

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