+ Reply to Thread
Results 1 to 5 of 5

Thread: UserForm -> Combobox and it's RowSource property?

  1. #1
    Registered User
    Join Date
    11-04-2010
    Location
    Ottawa, Ontario, Canada
    MS-Off Ver
    Excel 2002
    Posts
    13

    Question UserForm -> Combobox and it's RowSource property?

    Hi guys,

    Facts:
    I created a userform and in it, I have a combobox. In its properties, there's an item (RowSource) which allows you to let the user pick from a list (my list, in this case is a range called HR_Reps within the workbook). Basically, when clicking on the dropdown(combobox), you get a list of HR Representatives. The RowSource works fine while the Range is within the workbook.

    Challenge:
    I'm trying to put a range from a different file in RowSource...

    1 - Don't know the format
    2 - Is it even possible to do it?

    Let me know what you think...and thanks!

    Alex

  2. #2
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    537

    Re: UserForm -> Combobox and it's RowSource property?

    Alex, can you post an example of your workbook?

    There are a couple of ways to fill the combobox/listbox...post up your example so we can see which method may work best for you.
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  3. #3
    Registered User
    Join Date
    11-04-2010
    Location
    Ottawa, Ontario, Canada
    MS-Off Ver
    Excel 2002
    Posts
    13

    Talking Re: UserForm -> Combobox and it's RowSource property?

    Ah, I figured it out.

    In a nutshell, I had to do it in VBA because I couldn't do it from the property by changing RowSource. This would be a sample of what my code looks like.

    ---------------------------------------------------
    Private Sub UserForm_Activate()

    ' Updates ranges to reference file.

    With UserForm1
    .ComboBox1.RowSource = ("'L:\Folders\[Reference List.xls]Sheet1'!MyRange")
    End With

    End Sub

  4. #4
    Valued Forum Contributor
    Join Date
    11-29-2010
    Location
    Ukraine
    MS-Off Ver
    Excel 2003
    Posts
    2,488

    Re: UserForm -> Combobox and it's RowSource property?

    hi, CEC, if another workbook is open it works fine. format:

    [Xl0000115.xls]Data!$B$25:$B$30
    Xl0000115.xls - file name of open workbook
    Data - sheet name

    If the workbook is closed a full path needed.

  5. #5
    Registered User
    Join Date
    11-04-2010
    Location
    Ottawa, Ontario, Canada
    MS-Off Ver
    Excel 2002
    Posts
    13

    Smile Re: UserForm -> Combobox and it's RowSource property?

    Quote Originally Posted by watersev View Post
    hi, CEC, if another workbook is open it works fine. format:

    [Xl0000115.xls]Data!$B$25:$B$30
    Xl0000115.xls - file name of open workbook
    Data - sheet name

    If the workbook is closed a full path needed.
    In my case, it wouldn't be practicle. The main file will be distributed to hundreds of users...it's why I needed a remote range so I can only update 1 file (and not all hundreds of them) every time a representative comes/goes. Opening the file would turn it Read Only and then other users wouldn't be able to use it for that brief moment.

    The VBA methods works pretty good for me. Thanks though.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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.2.0