Private Sub Worksheet_SelectionChange(ByVal Target As Range) On Error Resume Next If Target.Column <> "3" Then
ComboBox1.Visible = False Exit Sub End If With ActiveSheet.Shapes("ComboBox1") .Visible = True .IncrementTop Target.Top + Target.Height - .Top .IncrementLeft Target.Left - .Left .Select Selection.LinkedCell = Target.Address End With Target.Select End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error Resume Next
If Target.Column <> 3 Then
ComboBox1.Visible = False
End If
If Target.Column <> 9 Then
ComboBox2.Visible = False
End If
If Target.Column <> 3 And Target.Column <> 9 Then Exit Sub
If Target.Column = 3 Then
C = "ComboBox1"
Else
C = "ComboBox2"
End If
With ActiveSheet.Shapes(C)
.Visible = True
.IncrementTop Target.Top + Target.Height - .Top
.IncrementLeft Target.Left - .Left
.Select
Selection.LinkedCell = Target.Address
End With
Target.Select
End Sub