+ Reply to Thread
Results 1 to 4 of 4

Adding the names of all macros in current workbook into a combobox

  1. #1
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Adding the names of all macros in current workbook into a combobox

    Hi There,

    I'm piecing together a few different macros that I have in an attempt to build a new one, and I'm running into a problem that I can't figure out.

    I have a button on a worksheet that launches a UserForm to have the user select which workbook they want to run a given macro on. The code, here:

    Please Login or Register  to view this content.
    works just fine. There are no issues with this.

    Right below that box is another button that prompts the user to select which macro they want to run on the book they selected in the first box.



    My second button, UserForm2, has the following code, which is NOT working properly:

    Code:

    Please Login or Register  to view this content.
    If I run the two subs ListofMacros and GetTheList outside of the userform, (in a module by themsleves), that I got verbatim off this forum - they work fine. They provide back to me the names of all the macros currently running in the active workbook. This is CLOSE to what I want - but instead of a msgbox, I want it to populate the combobox so that the user can select one.

    Since the MsgBox is giving back the variable list, I assume that list is the variable where the data is held - so I could use that in the combobox - but I'm getting something wrong.

    The code to actually provide the list of macros is too complicated for me to understand line by line, but this part:

    Code:
    Please Login or Register  to view this content.
    seems like it should be working. However, when I click the button to launch UserForm2, the combobox is empty, and I'm not sure where I'm going wrong.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Adding the names of all macros in current workbook into a combobox

    Try this...

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    08-16-2010
    Location
    Australia
    MS-Off Ver
    Excel 2010
    Posts
    132

    Re: Adding the names of all macros in current workbook into a combobox

    You are the man. I could not for the life of me figure out where that text needed to go. Thank you!

  4. #4
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Adding the names of all macros in current workbook into a combobox

    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. Replies: 3
    Last Post: 12-04-2013, 09:59 PM
  2. [SOLVED] Code that finds and deletes names from current sheet to all worksheets in workbook
    By grazian2 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-01-2013, 11:51 AM
  3. Replies: 2
    Last Post: 07-31-2013, 03:21 PM
  4. [SOLVED] Execute Macros from Other workbooks on current workbook
    By Allen in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-05-2006, 09:10 PM
  5. Addin macro to delete names in current workbook
    By David Iacoponi in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-15-2005, 02:05 PM

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