Forum Discussion

aconstant1735's avatar
aconstant1735
Copper Contributor
Aug 22, 2024

copy a cell value into a table based of the value of adjacent dropdown

good evening all,

 

having some trouble wrapping my head around this.

 

I have dropdowns in A4:A7 which draw values from A12:A101.  there is a corresponding value in B12:B101 that gets displayed in B4:B7 when a value is selected from the dropdown.  i would like to add an "update cell" in C4:C7 that would update the values in B12:B101 when a new value is entered.

 

i have a stripped down version to show what ive got so far

 

any help is appreciated

 

https://1drv.ms/x/s!AocIVX6UvuXYgs9RJ6UTv6sHKZEnmQ?e=rUrxa1

1 Reply

  • Harun24HR's avatar
    Harun24HR
    Bronze Contributor

    aconstant1735 Try the following codes. See attached file.

     

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim fWhat As String
    Dim fRng As Range
        
        If Not Intersect(Target, Range("C4:C7")) Is Nothing Then
            Application.EnableEvents = False
    
            fWhat = Target.Offset(0, -2).Value2
            
            With Sheets("Ladder")
                Set fRng = .Range("A14:A101").Find(fWhat, [A14], xlFormulas, xlPart, , , False)
                
                If Not fRng Is Nothing Then
                    fRng.Offset(0, 1) = Target.Value
                End If
            End With
            
        End If
        Application.EnableEvents = True
    End Sub

     

Resources