+ Reply to Thread
Results 1 to 5 of 5

Dynamically/Automatically written code

  1. #1
    Registered User
    Join Date
    02-12-2006
    Posts
    54

    Dynamically/Automatically written code

    I have a button called (MyButton) and I want when I click on it then it creates a combo box for me that has three items: "Item1","Item2", and "Item3" and to have the name of this combo box to be (MyList).

    Also, in the event of selecting any of this combo box items, then that item text gets printed in cell (A1). I want this code for the MyList_OnChange() subroutine to be automatically created for me when I click on the (MyButton).

    Wizards.. please help

  2. #2
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Good afternoon cgi_pro

    Does my response in this thread help:

    http://www.excelforum.com/showthread.php?t=579984

    I'm not 100% clear about what you want to do.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  3. #3
    Registered User
    Join Date
    02-12-2006
    Posts
    54
    Your answer is almost around what I want, however, whenever I put the code:

    Please Login or Register  to view this content.
    it gives me this error (check attachment please)
    Attached Images Attached Images

  4. #4
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile

    Hi cgi_pro

    Works OK for me - I'm using Excel 2003, what version are you using?

    It might be your references want setting. From the VBE go to Tools > References and in the dialog box find and check something that looks along the lines of :
    Micrrosoft Visual Basic for Applications Extensibility ...

    May vary slightly according to your version of Excel and click OK.

    HTH

    DominicB

    EDIT : If that doesn't work, and you're using XL2002 upwards go to Tools > Macro > Security, Trusted Publishers and check the Trust Access to Visual Basic Project. Let me know.
    Last edited by dominicb; 11-22-2006 at 11:03 AM.

  5. #5
    Registered User
    Join Date
    02-12-2006
    Posts
    54
    Thanks a million dominicb

    the 2nd way made it work for me

+ 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