+ Reply to Thread
Results 1 to 4 of 4

pass array to combobox_change subroutine

  1. #1
    Registered User
    Join Date
    03-05-2019
    Location
    Little Rock, AR
    MS-Off Ver
    2010
    Posts
    10

    pass array to combobox_change subroutine

    I am creating a userform with a combo box. I have a multidimensional array that I was able to use to create the list of items that the combo box dropdown menus displays in the UserForm_Initialize() subroutine . When a value is chosen, I need to do some stuff with the other information in the array associated with that value. How do I pass that array to the ComboBox1_Change() subroutine so that I can do something every time another value is chosen?

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,870

    Re: pass array to combobox_change subroutine

    If you declare the array at the top of the UserForm module (before any code) then it will be available to the whole module.
    You willalso need to ensure that the array is not declared anywhere else.
    Something like
    Please Login or Register  to view this content.

  3. #3
    Registered User
    Join Date
    03-05-2019
    Location
    Little Rock, AR
    MS-Off Ver
    2010
    Posts
    10

    Re: pass array to combobox_change subroutine

    Thanks for the response.

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,870

    Re: pass array to combobox_change subroutine

    You're welcome

+ 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] Pass Worksheet CodeName to Subroutine
    By PosseJohn in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 01-07-2016, 10:07 AM
  2. [SOLVED] Pass variable to a subroutine
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-30-2014, 11:52 PM
  3. How do you pass a column range as an argument to a subroutine?
    By parodytx in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-27-2013, 03:23 PM
  4. Pass a variable to another subroutine and get back the result
    By anandvh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-12-2013, 04:55 PM
  5. [SOLVED] Pass variable from a subroutine to another sub
    By jecazak in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2012, 07:29 PM
  6. [SOLVED] How do I pass More Than One value to a subroutine?
    By dziw in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-07-2005, 06:10 PM
  7. Replies: 4
    Last Post: 01-09-2005, 07:07 AM

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