+ Reply to Thread
Results 1 to 4 of 4

Assign a macro to a Combo Box (Form Control) ... via VBA ... not right clickIs

  1. #1
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Assign a macro to a Combo Box (Form Control) ... via VBA ... not right clickIs

    Is there a way to assign a macro to a Combo Box (Form Control) using VBA, rather than right-clicking in Excel and selecting "Assign Macro"?

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,430

    Re: Assign a macro to a Combo Box (Form Control) ... via VBA ... not right clickIs

    Use the OnAction property.

    example where subroutine Test is assigned to combobox.

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Assign a macro to a Combo Box (Form Control) ... via VBA ... not right clickIs

    Appreciate the response. It works as intended.

  4. #4
    Forum Contributor
    Join Date
    11-10-2009
    Location
    Perth, Australia
    MS-Off Ver
    Excel 2007
    Posts
    549

    Re: Assign a macro to a Combo Box (Form Control) ... via VBA ... not right clickIs

    Is it possible to assign the macro from an Add-In?
    I tried sheet1.Shapes("Drop Down 1").OnAction ="MyAddIn.xlam!Test" but it did not wok.
    Does the folder directory of the Add-In have to be specified? The reason is that I use 2 computers.

+ 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] Assign macro on spin button on sheet (form control)
    By CobraLAD in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-14-2016, 07:44 AM
  2. [SOLVED] Using macro to create a Form Control Button and Assign macro to it in a specified Cell
    By weige1989 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-30-2014, 11:51 AM
  3. Code works with Combo Box-Form Control, but not with Combo box - ActiveX Control
    By nangys in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-01-2014, 08:51 AM
  4. how to assign a different macro to each*combobox selection in form control....
    By kritigupta in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-03-2012, 03:04 AM
  5. how to assign a different macro to each*combobox selection in form control....
    By kritigupta in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-02-2012, 07:51 PM
  6. [SOLVED] Combo Box (Form Control) With Macro On A Graph Sheet
    By splendidus in forum Excel General
    Replies: 4
    Last Post: 06-05-2012, 03:57 AM
  7. Assigned Macro to Combo Box(Form Control)
    By pantus in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2009, 04:43 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