I have a workbook with two spreadsheets. Sheet1 includes two columns as below. Column F is a drop down list based on named range on sheet 3 and Column G is xlookup formula as below.
=XLOOKUP([@CUSTOMER],CustomerTable1[Customer], CustRange,"")
When a customer already on the drop down list is chosen, the CustNum column populates with appropriate CustNum from the table below. However, when a new customer is added on sheet1, there is VBA code to add the new customer name to the bottom of the Customer column on sheet 3. Then an inputbox allows the new customer number to be entered as coded below.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim CustNumb As Variant
Dim rngNum As Range
CustNumb = Application.InputBox(Prompt:="Enter a Number ONLY", Title:="Enter Number for New Customer", Type:=1)
If CustNumb <> "" Then
rngNum("CustRange").End(xlUp).Offset(1, 0).Select
rngNum.Value = CustNumb
End If
End Sub
The new customer number should be showing up in the last row of sheet 3, column E so the xlookup formula can have it enter on sheet1, Column G, but it does not.
Any help is much appreciated.
=XLOOKUP([@CUSTOMER],CustomerTable1[Customer], CustRange,"")
When a customer already on the drop down list is chosen, the CustNum column populates with appropriate CustNum from the table below. However, when a new customer is added on sheet1, there is VBA code to add the new customer name to the bottom of the Customer column on sheet 3. Then an inputbox allows the new customer number to be entered as coded below.
Private Sub Worksheet_Change(ByVal Target As Range)
Dim CustNumb As Variant
Dim rngNum As Range
CustNumb = Application.InputBox(Prompt:="Enter a Number ONLY", Title:="Enter Number for New Customer", Type:=1)
If CustNumb <> "" Then
rngNum("CustRange").End(xlUp).Offset(1, 0).Select
rngNum.Value = CustNumb
End If
End Sub
The new customer number should be showing up in the last row of sheet 3, column E so the xlookup formula can have it enter on sheet1, Column G, but it does not.
Any help is much appreciated.