Try something like this...
Private Sub Worksheet_Change(ByVal Target As Range)
Dim cell As Range, cboMain As ComboBox
If Not Intersect(Range("A:A"), Target) Is Nothing Then
Set cboMain = Me.ComboBox1
Application.ScreenUpdating = False
For Each cell In Intersect(Range("A:A"), Target)
If IsEmpty(cell) Then
On Error Resume Next
Me.OLEObjects("cbo" & cell.Offset(, 1).Address(0, 0)).Delete
On Error GoTo 0
Else
With Me.OLEObjects.Add(ClassType:="Forms.Combobox.1", _
Left:=cell.Offset(, 1).Left, _
Top:=cell.Offset(, 1).Top, _
Width:=cell.Offset(, 1).Width, _
Height:=cell.Offset(, 1).Height)
.Name = "cbo" & cell.Offset(, 1).Address(0, 0)
.ListFillRange = cboMain.ListFillRange
End With
End If
Next cell
Application.ScreenUpdating = True
End If
End Sub
Depending on what you want to achieve, this may be easier to implement with Form-type comboboxes instead.
Bookmarks