Fill ComboBox With Cell Range & Link ComboBox To Cell

  • Hi All,


    I have two questions.


    1). I have dates listed in excel (01/01/2006 to 12/31/2006) say from range B12:B376.


    How do I get these values to a ComboBox.


    2). If the above is possible and if I select a value in ComboBox say 08/07/2006, it should get updated in a particular cell say A1


    So selection of 08/07/2006 in ComboBox, should reflect 08/07/2006 in cell A1.


    Please Note: This ComboBox is on the UserForm and not on the Excel Sheet.



    Any Help on this.


    Thank you,
    Nirmal Udupa.

  • Re: Linking Combo Box To A Cell In Worksheet


    Code
    Private Sub UserForm_Initialize()
     Me.ComboBox1.List = Worksheets("Sheet1").Range("B12:B376").Value
    
    
    End Sub


    this code will populate the combobox everytime the userform is initialized


    for question 2 are you asking about some kind of lookup formula ?

  • Re: Linking Combo Box To A Cell In Worksheet


    Hi DavesExcel,

    Thanks for the code. It works perfectly.

    Let me explain the second question in detail.

    Now as i got the list in the ComboBox, When I select a value from the ComboBox, for example 08/07/2006, it should reflect in the Cell A1.

    i.e. Cell A1 should have the value 08/07/2006.

    This is not Vlookup that I am looking for, but the combobox text should reflect in the cell A1. Something like this below?.


    Code
    ComboBox1.text = sheets("sheet1").range("A1").value



    Thank you,
    Nirmal Udupa.

  • Re: Fill ComboBox With Cell Range & Link ComboBox To Cell


    Hi I realise that this thread is quite old, however I have a similiar question that may be answered simply. I have a userform that has a combo box that is populated by a range using the code in the last posts. What I was hoping to achieve is when the combo box value is selected in the combo box, there is a label that displays a range related to that selection. For example Lets say the combo box contains the range (Sheet1) (A1:A100) for instance. Lets say they are Contact names. In a Label area on the userform how can I get it to display the corrisponding email address of this contact? The email data is on the same sheet in a column next to the contact names column. Will it be a vlookup? Any help will be appreciated!

  • Re: Fill ComboBox With Cell Range & Link ComboBox To Cell


    Hye!somebody can help me how to solve this issue



    I have create a order database and I want to use a comand button and assign a marco.after assingn the macro the command button will link to the userform or any tab by clicking the command button..need to searching by Purchase order number..I want input the figure into text box to found it..just input the figure and then clik ok.the data will show only the selected PO No..any sugguestions?





    Thanks n regards
    Ady izwan shah

  • Re: Fill ComboBox With Cell Range & Link ComboBox To Cell


    Ady,


    Please read the fourm rules.


    Do not post your question in threads started by others - - this is known as thread hijacking.
    Always start a new thread for *YOUR* question. If you find it helpful to clarify your needs you can include a link to this ( or any other ) thread.


    When starting a new thread be sure to give it a search-friendly title that aptly describes your need.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!