Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box addItem question
Hi, I am looking to populate a combox with values from a column in a worksheet..... but not every row is populated. How do I filter out the rows that have no values from being populated in the combo box? Also - after my macro loads the userform - in the userform initialize function I'd like to query a specific worksheet to pull in the values explained above - but I'm getting an error that the object isn't valid. Any ideas? Thanks! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Box addItem question
Private Sub Userform_Initialize()
Dim sh as Worksheet Dim cell as Range set sh = Worksheet("sheet1") for each cell in sh.range(sh.cells(2,5),sh.cells(rows.count,5).End( xlup)) if not isempty(cell) then combobox1.AddItem cell end if Next End sub -- Regards, Tom Ogilvy "strataguru" wrote in message ... Hi, I am looking to populate a combox with values from a column in a worksheet..... but not every row is populated. How do I filter out the rows that have no values from being populated in the combo box? Also - after my macro loads the userform - in the userform initialize function I'd like to query a specific worksheet to pull in the values explained above - but I'm getting an error that the object isn't valid. Any ideas? Thanks! ------------------------------------------------ ~~ Message posted from http://www.ExcelTip.com/ ~~View and post usenet messages directly from http://www.ExcelForum.com/ |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Real quick: AddItem with combo boxes? | New Users to Excel | |||
additem to combobox with an array | Excel Discussion (Misc queries) | |||
Help with: ListBox1.AddItem (ws.Name) | Excel Worksheet Functions | |||
Multiple Column ComboBox using Additem | Excel Programming | |||
additem to listbox built on the fly | Excel Programming |