Consulting

Results 1 to 3 of 3

Thread: Drop down changes value of another drop down

  1. #1

    Drop down changes value of another drop down

    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 ...

  2. #2
    VBAX Expert
    Joined
    Oct 2012
    Posts
    726
    Location
    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

  3. #3
    Aww man...I feel so stupid!..nothing but common sense!..thanx a lot jonh..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •