+ Reply to Thread
Results 1 to 7 of 7

Editing a Combobox value

  1. #1
    Registered User
    Join Date
    02-09-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Editing a Combobox value

    Dear All,

    is there a way to edit a combobox value while it is active/showing in the combobox without having to go to the backend list that fills it?

    I wish to edit on the run!

    As an option I am thinking of when a user clicks on the value (not the down arrow!) then it triggers an event (such as bringing up a textbox to insert a string). Is there such an event?

    eg: combobox1.textclick = true

    Thanks in advance !

    punter.

  2. #2
    Valued Forum Contributor john55's Avatar
    Join Date
    10-23-2010
    Location
    Europe
    MS-Off Ver
    Excel for Microsoft 365
    Posts
    2,028

    Re: Editing a Combobox value

    hi punter1000,
    Try to edit the value in cbo, it works for me.
    john

  3. #3
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Editing a Combobox value

    You can use the doubleclickevent:

    Please Login or Register  to view this content.



  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Editing a Combobox value

    John's right, you can edit the text in a combobox, but are you trying to save the edit to the list?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  5. #5
    Registered User
    Join Date
    02-09-2011
    Location
    Australia
    MS-Off Ver
    Excel 2003
    Posts
    15

    Re: Editing a Combobox value

    Yes I am Roy (trying to save the edit to the list).

    In the meantime have created a button which brings up an inputbox with the combobox.value as the default string. I then edit in there and save it to the list, then clear the list, then refresh the combobox.

    All done in a blink of the eye without the user knowing what's happening behind the scenes (like everything in VBA).

    That's my fix, but being able to edit in the orginal combobox string would have been handy!

  6. #6
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Editing a Combobox value

    Look into the Style-property of the combobox.
    If style = combobox than you can edit the value; if the style = dropdownlist you can't.

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Editing a Combobox value

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

+ 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