+ Reply to Thread
Results 1 to 7 of 7

ComboBox display

Hybrid View

Jakes ComboBox display 11-21-2011, 02:55 AM
royUK Re: ComboBox display 11-21-2011, 03:03 AM
Jakes Re: ComboBox display 11-21-2011, 03:12 AM
royUK Re: ComboBox display 11-21-2011, 03:39 AM
Jakes Re: ComboBox display 11-21-2011, 04:12 AM
royUK Re: ComboBox display 11-21-2011, 05:29 AM
snb Re: ComboBox display 11-21-2011, 05:41 AM
  1. #1
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    ComboBox display

    Good morning,

    I have a quick question: I have a Combobox That I only want to display cell A2 from Sheet "PRJINFO", and I have the RowSource as PRJINFO!A2. Although it work okay, every time I open the form, the combobox is empty, and I need to use the drop down function and select the info. I want the info to display in the combobox without the need to use the drop down list and select the info?
    Any help will be appreciated

    Jakes
    Last edited by Jakes; 11-21-2011 at 04:12 AM.

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

    Re: ComboBox display

    Where is th combobox & what type is it?

    Why not use a TextBox instead?
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: ComboBox display

    Hi Roy,
    Thank you for the quick reply! I use a VB form to display project information which is saved on a spreadsheet (PRJINFO)
    So basically, I use the Combobox to select the Project ID, and the rest of the text boxes in my form display the rest of the info. The reason I d-ont use a text box, It does not have a RowSource option where I can specify the sheet and cell to display. If you can help me with that, it will be much appreciated!

  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: ComboBox display

    Add a Label or textBox to the UserForm then populate it when the form loads

    Option Explicit
    
    
    Private Sub UserForm_Initialize()
    Me.Label1.Caption = Sheet1.Cells(1, 1).Value
    Me.TextBox1.Value=Sheet1.Cells(1, 1).Value
    End Sub

  5. #5
    Forum Contributor
    Join Date
    03-03-2011
    Location
    South Africa
    MS-Off Ver
    Excel 2007
    Posts
    123

    Re: ComboBox display

    Thank you Roy!

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

    Re: ComboBox display

    Glad it helped

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

    Re: ComboBox display

    A textbox has a property 'Controlsource'.
    You can link the content of the textbox to a cell using controlsource.

    If you assign Sheet1!B10 to the property controlsource, the content of cell sheet!B10 will be shown in the textbox without the need for any VBA code in the Initialize event.



+ 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