Option
Explicit
Sub
TestCombo()
Call
MkCombo1(
"B2"
,
"Papa,Opa,Tante,Neffe"
)
End
Sub
Private
Function
MkCombo1(myAddi
As
String
, myList
As
String
)
Dim
oOle
As
OLEObject
Dim
c
As
Range
Dim
vLeft, vTop, vWidth, vHeight
Dim
arrModN()
As
String
, i
As
Integer
Dim
Sh
As
Worksheet:
Set
Sh = ThisWorkbook.ActiveSheet
Dim
blnScUp
As
Boolean
: blnScUp = Application.ScreenUpdating
If
blnScUp
Then
Application.ScreenUpdating =
False
arrModN = Split(myList,
","
)
With
Sh
With
.Range(myAddi)
vLeft = .Left
vTop = .Top
vWidth = .Width * 2
vHeight = .Height * 1.3
End
With
Set
oOle = .OLEObjects.Add(ClassType:=
"Forms.ComboBox.1"
)
With
oOle
.Left = vLeft
.Top = vTop
.Width = vWidth
.Height = vHeight
With
.
Object
.List = arrModN
End
With
End
With
End
With
Application.ScreenUpdating = blnScUp
End
Function