View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default setting combobox style using vba

Maybe...

ole.Object.Style = fmStyleDropDownList



"michael.beckinsale" wrote:

Hi all,

I have used the following code to set the linked cell for the
comboboxes in my spreadsheet but now want to set the Style to
fmDropDownList but when l insert that line it causes an error. Can
anybody help please?

Sub setlinkedcell()

Dim ole As OLEObject
Dim RowNo As Long
RowNo = 11
For Each ole In ActiveSheet.OLEObjects
If TypeOf ole.Object Is MSForms.ComboBox Then
If ole.Name Like "ComboBox*" Then
ole.LinkedCell = "H" & RowNo
ole.Style = fmStyleDropDownList causes error
End If
End If
Next

End Sub

TIA

Kind regards

Michael Beckinsale


--

Dave Peterson