Results 1 to 6 of 6

Remove current item on combobox

Threaded View

MarmaladeLover Remove current item on... 09-26-2014, 12:34 PM
Izandol Re: Remove current item on... 09-26-2014, 12:38 PM
Izandol Re: Remove current item on... 09-26-2014, 12:38 PM
MarmaladeLover Re: Remove current item on... 09-26-2014, 12:46 PM
Izandol Re: Remove current item on... 09-26-2014, 12:55 PM
MarmaladeLover Re: Remove current item on... 09-29-2014, 09:08 AM
  1. #1
    Registered User
    Join Date
    09-08-2014
    Location
    -
    MS-Off Ver
    -
    Posts
    68

    Remove current item on combobox

    Right, the title says it all - for part of my code, I need to remove the select item on the combobox.

    I've tried a variety of things, such as:

    'Suggested by the microsoft website
    ComboBox1.Items.Remove (ComboBox1.SelectedItem)
    'I know the ComboBox1.RemoveItem works as I've used it before. Just doesn't work when the argument is ComboBox1.Value
    ComboBox1.RemoveItem (ComboBox1.Value)
    Dim myVar$
    myVar = ComboBox1.Value
    ComboBox1.RemoveItem (myVar)
    Nothing works. I always get the following error:
    Capture.PNG

    I know this error pops up when the required item isn't found.

    For reference, the items in the combo box always have the format index number - name - price
    so for example 3 - Hotel in London - £4,392.30
    Any suggestions? It should be simple really. All it does is transfer the combobox item to another combobox, then delete the initial combobox item.


    Also, on another note, is there code to create objects on a userform - e.g. create a new caption?


    Thanks!
    Lady Marmalade
    Last edited by MarmaladeLover; 09-26-2014 at 12:38 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. selecting an item in combobox, the item does not get selected
    By AVM in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-14-2014, 05:14 AM
  2. [SOLVED] set string as the current selected item in oleobject combobox
    By jed38 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 11-29-2013, 11:21 AM
  3. Combobox: How to determine the location of the selected item if combobox has rowsource
    By ahsanzafar in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2012, 03:24 PM
  4. Add only when item is current and consecutive
    By burris in forum Excel General
    Replies: 2
    Last Post: 08-11-2010, 11:59 AM
  5. Remove Item in a combobox
    By aman1234 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-06-2009, 08:19 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