to show to hide, Drop Down

I

Isaac

Dear Amigos: It wanted to see like hiding or to show a Drop Down, which I
need is that if in the cell a1 the value is of 1, shows drop down 1, and if
the value a1 is equal to 2, then drop down 1 is hidden, I wait for is
possible, I wanted to modify the code down but I could not, logically the
code is shot when the values in a1 are fulfilled, Greetings Isaac

Private Sub hidden_DropDown()
Me.Shapes("drop down 1").Visible = DropDown.Value = -1
SendKeys "{esc}"
End Sub
 
D

Dave Peterson

I used the worksheet_change event (A1 was changed by typing) to hide dropdown 1:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Then Exit Sub
If Intersect(Target, Me.Range("a1")) Is Nothing Then Exit Sub

Me.DropDowns("Drop down 1").Visible = CBool(Target.Value = 1)

End Sub

This code goes behind the worksheet that has the dropdown.

Change that 1 to what you want. I was confused by how you used the -1 and 1.
 
Top