+ Reply to Thread
Results 1 to 2 of 2

VBA code to ComboBox (ActiveX Control)

  1. #1
    Registered User
    Join Date
    04-03-2012
    Location
    Sri Lanka
    MS-Off Ver
    Excel 2013
    Posts
    26

    Unhappy VBA code to ComboBox (ActiveX Control)

    Hi All,

    Please someone help me to put a drop down list to an combo box in which I need to assign a separate macro for each selected item in the drop down to gather data from different sheet.

    this is the code which i used but when i select an item from the list the list keep getting accumulated and getting longer one by one.

    Private Sub ComboBox1_Change()

    With Sheet1.ComboBox1
    .AddItem "Paris"
    .AddItem "New York"
    .AddItem "London"
    End With

    End Sub


    Thanks!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: VBA code to ComboBox (ActiveX Control)

    .clear
    then .additem

    you need to clear the combobox first or it will just keep adding items to it.

+ 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. VBA Code Vs Vlookup formula for ActiveX Control Combobox
    By newqueen in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-04-2014, 04:35 PM
  2. Validation or ComboBox ActiveX/Form Control...
    By brucemc777 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-20-2014, 01:10 PM
  3. How not to move ComboBox (activex control)
    By marky000 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-19-2012, 02:37 PM
  4. Set ComboBox (ActiveX Control) value to cell
    By farzyness in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-11-2011, 01:59 PM
  5. [SOLVED] ActiveX ComboBox Control on Sheet
    By quartz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-13-2005, 03:06 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