+ Reply to Thread
Results 1 to 8 of 8

Question Only: Can You Reference a userform combobox in a spreadsheet formula?

  1. #1
    Forum Contributor
    Join Date
    04-23-2014
    Location
    Liverpool...ish
    MS-Off Ver
    Excel 2013
    Posts
    126

    Question Only: Can You Reference a userform combobox in a spreadsheet formula?

    I have a formula that references data validation dropdowns on a sheet. I would like to relocate those dropdowns to a userform in the form of a combobox but leave the reference list and the processing on the spreadsheet. Is it possible?

  2. #2
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Question Only: Can You Reference a userform combobox in a spreadsheet formula?

    Short answer, NO, you can't refer to a combobox with a sheet formula.

    However, you CAN refer to the Cell(s) that combobox get's its values from and/or where it put's the value that is selected in the combobox..
    Which type of combobox is on the form, ActiveX or Userform?

  3. #3
    Forum Contributor
    Join Date
    04-23-2014
    Location
    Liverpool...ish
    MS-Off Ver
    Excel 2013
    Posts
    126

    Re: Question Only: Can You Reference a userform combobox in a spreadsheet formula?

    It is a userform control.

    I have added an example of what I am doing on the spreadsheet. The dropdown interacts in two ways. The formula sees what happened in the dropdown selection and then changes the choices available. I don't know if you can't give direct control to a combobox if it can be done but If you would have a look I would appriciated it.

    Thanks
    Scott

    Adjusting List Content - Allocations.xlsm

  4. #4
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Question Only: Can You Reference a userform combobox in a spreadsheet formula?

    If your goal (according to the notes in the book you posted) is to do it all in VBA
    Then there's no need for a sheet formula to refer to the combobox.
    Or did I miss something?

    With VBA, you can refer to the value selected in the combobox like

    MsgBox UserForm1.ComboBox1.Value

  5. #5
    Forum Contributor
    Join Date
    04-23-2014
    Location
    Liverpool...ish
    MS-Off Ver
    Excel 2013
    Posts
    126

    Re: Question Only: Can You Reference a userform combobox in a spreadsheet formula?

    Yeah... that little bit about too little knowledge to do the coding. I am learning... slowly so just trying to do the things I think I can understand.

    Thanks

  6. #6
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Question Only: Can You Reference a userform combobox in a spreadsheet formula?

    OK, no worries..

    Again, the cold hard answer to the question is still NO.
    A formula can't refer to a combobox.


    But speaking in general terms..
    The use of a userform is generally for a user to enter data. And that data is then transferred to the sheet somewhere. (adding a record)
    So your formulas don't 'need' to refer to the combobox.
    Instead, they can refer to the cell(s) that the combobox put it's value in.

    Also, generally speaking, comboboxes Get their initial 'list' of values (which a user selects one from) from a range of cells already on the sheet.
    So your formulas can refer to those cells as well, instead of trying to refer to the list contained in the combobox.

  7. #7
    Forum Contributor
    Join Date
    04-23-2014
    Location
    Liverpool...ish
    MS-Off Ver
    Excel 2013
    Posts
    126

    Re: Question Only: Can You Reference a userform combobox in a spreadsheet formula?

    Thanks for the little push. Sometimes I just need a little kick.... It wasn't as difficult as I had thought. Perhaps one day I will figure this stuff out without what now looks like an elementary question.... but atleast I know that you can't reference a userform control in a spreadsheet formula.:-)

    Thanks
    Scott

  8. #8
    Forum Guru Jonmo1's Avatar
    Join Date
    03-08-2013
    Location
    Bryan, TX
    MS-Off Ver
    Excel 2010
    Posts
    9,763

    Re: Question Only: Can You Reference a userform combobox in a spreadsheet formula?

    Glad to help, thanks for the feedback.

+ 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. A question about combobox usage in a vba userform
    By TheScott in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-28-2015, 09:46 AM
  2. [SOLVED] loop through a spreadsheet looking for the value from a userform combobox
    By alexmech in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-01-2013, 01:13 AM
  3. Question about a combobox on userform
    By GregJG in forum Excel General
    Replies: 3
    Last Post: 10-26-2007, 03:25 PM
  4. UserForm ComboBox RowSource Question
    By Minitman in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-15-2005, 03:10 PM
  5. UserForm TextBox/ComboBox question
    By grasping@straws in forum Excel General
    Replies: 1
    Last Post: 02-02-2005, 08:06 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