Populate combobox

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

Anyone know what code is needed to populate a combobox?

On a sheet there is a column heading called "category" another heading
called "business name" I only want to populate the combobox from a
specified name within the category column. This would thereby only display
the business names for that particular category.

Many thanks if you can be of help.
Pat
 
set rng = Range(Cells(1,1),Cells(rows.count,1).End(xlup))
for each cell in rng
if cell.Value = "Category1" then
userform1.Combobox1.AddItem cell.offset(0,1).Value
end if
Next

It might be faster to filter the data.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top