On a userform, I have a combobox whose row source is a list of numbers and two text boxes. The number selected is inserted into a cell on a worksheet that serves as a VLOOKUP reference. This works fine. I need the looked up values to become the values of TextBox1 and TextBox2 but when I run the macro, the textboxes remain blank. I have done something similar with textboxes many times before without problems but I obviously cannot see the wood for the trees.
The code I am trying to use is this:
Dim customerID As Range
Set customerID = Worksheets("Interface").Range("D8")
num = ActiveCell.CurrentRegion.Rows.Count
Names.Add Name:="customer", RefersTo:=Sheets("Customer").Range("$a$2:$h$" & num)
Names.Add Name:="CID", RefersTo:=Sheets("Customer").Range("$a$2:$a$" & num)
Dim ComboBox1 As ComboBox
Set ComboBox1 = UserForm1.ComboBox1
customerID = ComboBox1
TextBox1 = Sheets("Interface").Range("E7")
TextBox2 = Sheets("Interface").Range("F7")
When I scroll through the macro, it reports the correct values. Any ideas?