+ Reply to Thread
Results 1 to 4 of 4

Using VBA to automatically select a value in another list or combo box

  1. #1
    Registered User
    Join Date
    11-13-2013
    Location
    uk
    MS-Off Ver
    Excel 2013
    Posts
    15

    Using VBA to automatically select a value in another list or combo box

    Hi I have two list boxes that I'd like to be able to select the value in one list and it automatically selects the value in the second list. but I'd also like to be able to change the value from the default selection in list 2 - so initially it might have one value but the user opts for a different value.

    Column A contains a cell (possibly with data validation list or combo box - which ever will work with this!) that will have Yes / No / Maybe
    Column B contains a drop down list with Yes / No / Maybe values

    If Yes is selected in column A then select yes from the list in column B
    If Maybe then select maybe from the list in column B

    Values in Column B need to be able to be changed by the user (e.g. although Yes = Yes there may be circumstances where it actually needs to be Maybe etc)

    This is a simplified version of what I am trying to do and there will be a number of cells this needs to be applied to with different outcomes, I believe this needs to be done in VBA as my current approach of using a list box / formula means that the formula is over written when the list box is used, so if value in Column A is then changed the changes don't flow through the worksheet.

    Example attached!Book1.xlsx

  2. #2
    Valued Forum Contributor Sean Thomas's Avatar
    Join Date
    03-25-2012
    Location
    HerneBay, Kent, UK
    MS-Off Ver
    Excel 2007,2016
    Posts
    971

    Re: Using VBA to automatically select a value in another list or combo box

    quite straight forward with comboboxes
    Please Login or Register  to view this content.
    Regards
    Sean

    Please add to my reputation if you think i helped
    (click on the star below the post)
    Mark threads as "Solved" if you have your answer
    (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code:
    [code] Your code here [code]
    Please supply a workbook containing example Data:
    It makes its easier to answer your problem & saves time!

  3. #3
    Registered User
    Join Date
    11-13-2013
    Location
    uk
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Using VBA to automatically select a value in another list or combo box

    Brilliant! Thanks - If I add a third combo box with Values A B and C can I add that into the Sub?

    I.e. If combobox2.value = "Yes" then combobox3.value = "B"

  4. #4
    Registered User
    Join Date
    11-13-2013
    Location
    uk
    MS-Off Ver
    Excel 2013
    Posts
    15

    Re: Using VBA to automatically select a value in another list or combo box

    I've moved on a little from the above and tried to adapt it

    Please Login or Register  to view this content.
    but it still isn't happy. Ideally the second combobox would actually be a data validation drop down but whoever I can get working I'll be happy with!

    Incidentally I managed to link a list box to a combo box with this code
    Please Login or Register  to view this content.
    I've tried both of these on the 'ThisWorkbook' and 'Sheet1' locations in the VBA window

    Are they in the correct place?

+ 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. Replies: 1
    Last Post: 03-23-2015, 03:36 PM
  2. [SOLVED] Select a specific value from the dropdown list and automatically diverted to another tab
    By alice2011 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2014, 01:52 PM
  3. Automatically select data depending on what's chosen in a drop-down list
    By Cormentia in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-24-2011, 11:55 AM
  4. Combo box command to select from unique data list
    By AndyE in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-17-2010, 09:59 PM
  5. Select list item from combo box and add data
    By mli in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-15-2009, 02:08 AM
  6. Replies: 0
    Last Post: 10-16-2006, 02:32 PM
  7. [SOLVED] Select all data in column and list in form combo box
    By burl_rfc in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-10-2006, 09:50 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