PDA

View Full Version : combo box but no Rowsource property



lazybum
10-03-2005, 10:19 AM
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?

shades
10-03-2005, 11:00 AM
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.

lazybum
10-03-2005, 12:01 PM
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.

BlueCactus
10-03-2005, 09:35 PM
This shouldn't be too hard. Although I've never personally used .RowSource, the following ought to be more or less equivalent:

ComboBox1.RowSource = ActiveSheet.Range("B3:B7")

ComboBox1.List = ActiveSheet.Range("B3:B7")

lazybum
10-04-2005, 06:55 AM
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.

cscribner
10-09-2005, 12:42 PM
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):
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

lazybum
10-16-2005, 10:38 AM
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 :)