View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Paul Reynolds[_2_] Paul Reynolds[_2_] is offline
external usenet poster
 
Posts: 8
Default Changing the Style of a Combobox Via It's Name

You can do this via the OLEObjects collection for the sheet, e.g:

Private Sub SetStyleCombo(sComboBoxName as String)
Worksheets("Sheet1").OLEObjects(sComboBoxName).Obj ect.Style =
fmStyleDropDownCombo
End Sub

Hope this helps,
Paul

"Kent" wrote in message
...
I have multiple comboboxes addes to a worksheet. I would like to write a
subroutine that changes the style property of the combobox. I want to
reference the combobox by its name that is passed as a parameter to the
subroutine. I can't seem to write the code that references the combobox by
this passed parameter name.

Thanks,
Kent