PDA

View Full Version : [SOLVED] Drop down changes value of another drop down



Juriemagic
06-04-2015, 06:13 AM
Hi good people,

I have searched and finally found pieces of code that I put together to accomplish the following: I have two drop downs B2 and D2. B2 drop down selects different text while D2 selects different values. What I really need to happen is when I make a change in B2, the value in D2 must change to 102. Then after this I must be free still to select any figure using D2. It's required to change to 102 only when I use B2. I have a code but it keeps executing and forcing D2 to 102. I'm sure it's just something small, any and all help will be accepted with great appreciation. This is the code I have:

If Not Range("B2") Is Nothing Then
Range("D2").Value = 102


thank you ...

jonh
06-05-2015, 02:31 AM
Use the worksheet change event and check which cell is being changed.


Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$B$2" Then Range("$D$2") = 102
End Sub

Juriemagic
06-05-2015, 03:13 AM
Aww man...I feel so stupid!..nothing but common sense!..thanx a lot jonh..