Consulting

Results 1 to 7 of 7

Thread: combo box but no Rowsource property

  1. #1

    combo box but no Rowsource property

    Well, I've got a userform with a combobox that is populated using the rowsource property. It works just fine on PCs, but, I have a school user who's forced to use a Mac. And, of course, there is no rowsource property available. So, does anyone have any ideas how to get around this? Is there a workaround?

  2. #2
    Mac Moderator VBAX Expert shades's Avatar
    Joined
    May 2004
    Location
    Kansas City, USA
    Posts
    638
    Location
    Howdy, and welcome to the board.

    I know that from testing for others, UserForms are problematic when trying to accomodate the Mac, since MS has based Mac VB on VB 5 not VB 6, and no ActiveX support, etc.

    Can you post a sample? I won't be able to look at it for a day or two, but I know others on the board who have experience in this area may be able to help sooner.

    Software: LibreOffice 3.3 on Mac OS X 10.6.5
    (retired Excel 2003 user, 3.28.2008 )
    Humanware: Older than dirt
    --------------------
    old, slow, and confused
    but at least I'm inconsistent!

    Rich

  3. #3
    Thanks for the welcome.

    I guess I'm not sure what I need to post. I have a combo box on a userform with rowsource property set to database!a:a There really isn't any code involved other than that. When I load the userform, it populates the combo box with all of the data in column A from the sheet called "database" But, on a Mac, there is no rowsource property, so I'm not sure how to produce the same results.

  4. #4
    VBAX Tutor
    Joined
    Mar 2005
    Posts
    268
    Location
    This shouldn't be too hard. Although I've never personally used .RowSource, the following ought to be more or less equivalent:

    [vba]ComboBox1.RowSource = ActiveSheet.Range("B3:B7")[/vba]

    [vba]ComboBox1.List = ActiveSheet.Range("B3:B7")[/vba]

  5. #5
    Hmmm, I don't remember having a straight up list property for the comboBox on the userform, but then again, I could certainly be wrong. I won't have access to the machine until this weekend, so I'll take a look then and give it a try.

  6. #6
    It's not really what you're asking, but my original frustration with the lack of .rowsource on a mac was that I had defined the list as a named range in Excel, and I couldn't seem to add those values by their name into my userform combobox. Anyway, this is pretty much like what the last guy said, but this is the way I could populate the combobox with lists that didn't necessarily remain static over time. The only thing that had to stay the same was the column in which the list was kept.

    In this case, my list of owners was in column 7 (G):
    [VBA] Me.OwnerListCombo.Clear
    FinalRow = Sheets("Lists").Cells(65536, 7).End(xlUp).Row
    For i = 2 To FinalRow
    Me.OwnerListCombo.AddItem (Sheets("Lists").Cells(i, 7).Value)
    Next i[/VBA]

  7. #7
    Hi, thanks, almost worked. I can scroll through all of the data, but I can't select any of it. When I click on the item that I want, it simply clears the combo box

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •