thanks in advance for your help.
I am trying to get a Sub worksheet_change to trigger when the value in B2 is changed using a vlookup formula from a dropdown in A2.
When I manually type a supplier number into B2 it triggers and list fine, but when I use the dropdown it will not fire.
Dropdown in A2 is my supplier name, B2 would have a vlookup formula, this is the cell I need to trigger the worksheet change.
The below is the code that I currently have and is working 100% accurate if I manually input.
Private Sub Worksheet_Change(ByVal Target As Range)
With Target
If .Address = “$B$2” And Len(.Cells(1).Value) > 0 Then
Dim objDic As Object, rngData As Range
Dim i As Long, sKey As String, sSupp As String
Dim lastRow As Long, arrData
Dim oSht1 As Worksheet
Set oSht1 = Sheets("WRICFY")
sSupp = .Value
lastRow = oSht1.Cells(oSht1.Rows.Count, "Z").End(xlUp).Row
Set rngData = oSht1.Range("D1:Z" & lastRow)
arrData = rngData.Value
Set objDic = CreateObject("scripting.dictionary")
For i = LBound(arrData) To UBound(arrData)
sKey = arrData(i, 1) ' Col D [Supplier]
If StrComp(sSupp, sKey, vbTextCompare) = 0 Then
objDic(arrData(i, 23)) = ""
End If
Next i
' Write Product list to sheet
lastRow = Me.Cells(Me.Rows.Count, "A").End(xlUp).Row
Application.EnableEvents = False
If lastRow > 15 Then Me.Range("A21:A" & lastRow).ClearContents
If objDic.Count > 0 Then Me.Range("A21").Resize(objDic.Count, 1) =
Application.Transpose(objDic.keys)
Application.EnableEvents = True
End If
End With
End Sub