Greetings experts,
I have this code which I populate some cells and it works for the AutoPopulateExistingVendorCode but not for the AutoPopulateAvailability. For the AutoPopulateAvailability, I am trying to populate cell D20 based on cell D18, the value in cell D18 will exist in another sheet called "IO Number" and cell D20 will be populated based on cell D18's column G value in this sheet.
Any help is much appreciated!
I have this code which I populate some cells and it works for the AutoPopulateExistingVendorCode but not for the AutoPopulateAvailability. For the AutoPopulateAvailability, I am trying to populate cell D20 based on cell D18, the value in cell D18 will exist in another sheet called "IO Number" and cell D20 will be populated based on cell D18's column G value in this sheet.
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Count > 1 Then Exit Sub
If Target.Address <> [D10].Address Then Exit Sub
If Target = "" Then Exit Sub
AutoPopulateExistingVendorCode
If Target.Count > 1 Then Exit Sub
If Target.Address <> [D18].Address Then Exit Sub
If Target = "" Then Exit Sub
AutoPopulateAvailability
If Range("D16").Value > 1000 Then
MsgBox ("Please request a new vendor code from ESP before continueing")
End If
End Sub
Sub AutoPopulateExistingVendorCode()
Dim rng As Range
Set rng = Sheets("Vendor Code List").Columns("f").Find([D10], lookat:=xlWhole)
If Not rng Is Nothing Then [D12] = rng.Offset(, -1)
End Sub
Sub AutoPopulateAvailability()
Dim rng As Range
Set rng = Sheets("IO Number").Columns("a").Find([D18], lookat:=xlWhole)
If Not rng Is Nothing Then [D20] = rng.Offset(, 5)
End Sub
Any help is much appreciated!