I am trying to make a macro that will create an XLOOKUP for me. This is my first post so if I do something wrong let me know. This is my code and it's not working. Can anyone see why?
Sub XLOOKUP()
Dim NUM1 As Variant
Dim NUM2 As Variant
Dim NUM3 As Variant
NUM1 = Application.InputBox("Enter the value you want to lookup.", "Lookup Value", Type:=1)
NUM2 = Application.InputBox("Enter the range you want to find the lookup value.", "Lookup Array ", Type:=1)
NUM3 = Application.InputBox("Enter the range that you want to return.", "Return Array", Type:=1)
ActiveCell.Formula = "=XLOOKUP(NUM1 & CHAR(34) & NUM2 & CHAR(34) & NUM3)"
End Sub
Sub XLOOKUP()
Dim NUM1 As Variant
Dim NUM2 As Variant
Dim NUM3 As Variant
NUM1 = Application.InputBox("Enter the value you want to lookup.", "Lookup Value", Type:=1)
NUM2 = Application.InputBox("Enter the range you want to find the lookup value.", "Lookup Array ", Type:=1)
NUM3 = Application.InputBox("Enter the range that you want to return.", "Return Array", Type:=1)
ActiveCell.Formula = "=XLOOKUP(NUM1 & CHAR(34) & NUM2 & CHAR(34) & NUM3)"
End Sub